Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
1 vote
0 answers
82 views

I am attempting to hook into the functions within the PDO class. I declared the zend_execute_internal function and hooked it by setting the address of my custom function, but in the code of New Relic ...
김성훈's user avatar
0 votes
1 answer
74 views

I am making a big PHP array and then remove most of the beginning of it. As we know it won't free the memory only mark removed items as Undef, as explained by Nikita here. However when I put more ...
Dmitry Lezhnev's user avatar
0 votes
0 answers
124 views

I've seen many questions about this (one of them here) $a = array('a', 'b', 'c', 'd'); foreach ($a as &$v) { } foreach ($a as $v) { } print_r($a); and I get the answers, you shouldn't be ...
Vali's user avatar
  • 14
0 votes
1 answer
74 views

i am new to php . i want to know the place where the array data and the address of array are being stored ? are they storing in heap and stack , respectivelylike C# ? I read many articles but I could ...
omar mahmoud's user avatar
1 vote
0 answers
49 views

I've been reading about memory management in PHP and learned that variables in PHP copy the reference to zvals as long as you don't do a write operation (copy on write paradigm). https://www....
tweekz's user avatar
  • 368
0 votes
0 answers
30 views

Title. Since you can enable escape analysis, there should also be an opcode that uses stack allocation instead of heap, right? Or how would that work?
Olle Härstedt's user avatar
1 vote
0 answers
313 views

I'm trying to fix some php 8.1 deprecation notices in a PHP extension, which I believe involves either adding return type-hints (where possible, whilst maintaining some backwards-compatibility to php7....
Brett McBride's user avatar
1 vote
1 answer
298 views

Searching for it I found this blog post: https://www.npopov.com/2017/04/14/PHP-7-Virtual-machine.html Does it cover "everything" needed to add a new opcode, or all the places I'd need to ...
Olle Härstedt's user avatar
4 votes
0 answers
313 views

I am following a tutorial & reading through some articles on how variables are stored in PHP using zval (zend value) container. Most of those articles seem to be following & getting ...
Fuze's user avatar
  • 113
2 votes
0 answers
207 views

I can't figure out how to call an existing PHP function, everytime I end up either with a segmentation fault or a Fatal error. Disclaimer: I'm not experienced at all in low level programming, just ...
Bloops's user avatar
  • 773
0 votes
1 answer
231 views

My question is about HashTable: The PHP VERSION debugged is PHP-7.0.12, I couldn't find out where the zval's str member is updated within the macro "ZVAL_COPY_VALUE(z, v)" when I add one new ...
phpmooc's user avatar
  • 33
4 votes
1 answer
293 views

You can lookup built-in functions by searching for e.g. PHPAPI(stream_copy_to_stream) and find the implementation in ext/standard/streamsfuncs.c. How to do that for a language construct like echo? I ...
cachius's user avatar
  • 2,015
0 votes
0 answers
464 views

In PHP 5.4 How much memory is allocated to a script, when we set memory_limit to -1 ? Memory exhausted error will not come until all memory is exhausted . But will this affect my other processes too? ...
chaitanya's user avatar
9 votes
1 answer
3k views

The list of backwards-incompatible changes for PHP 7.4 contain the following note: Serialization The o serialization format has been removed. As it is never produced by PHP, this may only break ...
HappyDog's user avatar
  • 1,369
4 votes
1 answer
474 views

I was trying to get a better understanding of PHP's internal mechanisms of string interning - more specifically: What are the rules PHP uses to determine whether (or not) the string created in ...
Smuuf's user avatar
  • 6,583
1 vote
1 answer
615 views

The PHP docs on session_name() say: It should contain only alphanumeric characters; it should be short and descriptive (i.e. for users with enabled cookie warnings). ... The session name can't ...
Synchro's user avatar
  • 38.1k
2 votes
0 answers
396 views

I'm trying to allocate memory dynamically in my code and release them ,I tried to use zend_mm but I couldn't add it to php 7,I'm using php 7.4 and xampp server , if it is impossible please tell my the ...
M.sharf's user avatar
  • 21
1 vote
1 answer
617 views

Hope this isn't too silly a question to ask. I'm fairly new to C and PHP internals but looking to learn more about them. I've recently began looking into development of PHP extensions. I'm trying to ...
fufyayokku's user avatar
0 votes
1 answer
97 views

I am trying to make a PHP (7.4) extension use in an extension method a setting from php.ini (like myext.map=key1=val1,key2=val2;) parsed as an associative array. I want the parsing to happen in ...
Alexander Mashin's user avatar
0 votes
1 answer
103 views

Is the zval * value returned by the zend api method zend_call_method same as the zval *retval argument passed into it? I can see that zend_call_method is declared in zend_interfaces.h. I tried ...
Joyce Babu's user avatar
  • 20.9k
4 votes
1 answer
873 views

As far as I can tell php has the ability to prevent a return type from being declared where it knows it's problematic. class Foo { public function __clone(): Baz { return new Baz; } } ...
emptyheap's user avatar
4 votes
1 answer
1k views

I was looking through php-src/Zend/zend_API.c and couldn't find the source code for the strlen() function in PHP anywhere. Grepping through the code base didn't really help as it's littered with libc ...
emptyheap's user avatar
2 votes
3 answers
2k views

Yesterday at work I stumbled upon a piece of code that was roughly like this: uasort($array, function($a, $b) { return isset($a['sort_code']) && isset($b['sort_code']) && $a['...
tomtom's user avatar
  • 21
8 votes
3 answers
455 views

The title may seem a bit silly but I'm totally serious with this. Today at work I came across a weird PHP behaviour which I could not explain. Luckily this behaviour is fixed in PHP 7.4, so it seems ...
Benjamin Paap's user avatar
2 votes
1 answer
244 views

I know that using mysqli_close() is not needed, because PHP will destruct the object when the script is finished. What I would like to know is why do we have such a function in the language in the ...
Dharman's user avatar
  • 33.9k
0 votes
1 answer
483 views

i am trying to warp a C library around a PHP class using PHP's Zend Engine. The constructor function of the class is supposed to take a string and a function pointer. I was able to fetch strings ...
AKJ's user avatar
  • 1,058
1 vote
1 answer
316 views

I recently needed a list of compiled-in signal names so I could print nice messages like "Interrupted by SIGINT (2)". get_defined_constants() is unusable for this as it jumbles SIGINT, SIGTRAP etc in ...
i336_'s user avatar
  • 2,081
2 votes
1 answer
551 views

LINK: unresolved external symbol :php_pdo_register_driver I'm writing a PHP PDO ext demo with PHP7.2.21, when I tried to register my ext on PDO, I got an error. PHP_MINIT_FUNCTION(pdo_my_mysql) { #...
Deric Lee's user avatar
0 votes
1 answer
172 views

I'm experimenting with a way to more easily debug Cronjob Scripts with PHP. without having xdebug etc. accessible on the server. For this, I'd like to get the number of nested structures the code ...
Philipp's user avatar
  • 137
0 votes
0 answers
63 views

I want to find where such messages are generated at a low level. Uncaught TypeError: Argument 1 passed to A::__construct() must be an instance of B I downloaded the source PHP 7. And tried to find ...
Eugene Kapelko's user avatar
11 votes
2 answers
1k views

I always thought that in_array strict mode will be faster or at least the same speed as non-strict mode. But after some benchmarks I noticed there is a huge difference in execution time between them ...
Tom's user avatar
  • 389
4 votes
1 answer
405 views

I'm dumping a zval container running on PHP version 7.3.5 (opcache is activated and PHP is thread safe enabled) following this given code : <?php $a = "new string"; $b = $a; xdebug_debug_zval( '...
gla's user avatar
  • 131
0 votes
0 answers
57 views

I have a PHP C++ extension that monitors the web requests and captures the required request details with Call stacks. Here from my PHP C++ extension whenever curl_exec(..) happens and a HTTP ...
Sel_va's user avatar
  • 608
2 votes
1 answer
282 views

I have created php extension in c++.In version php 5.6 can able to get currently executed function details. I was getting the arguments value as follows, if (real_execute_data->function_state....
Durai's user avatar
  • 87
1 vote
0 answers
45 views

uninitialized_zval appears in multiple places in the PHP kernel, but I don't know what it does. For example, in the ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CONST_HANDLER handler: ...
hantao huang's user avatar
5 votes
2 answers
2k views

In PHP, the allow_url_fopen flag controls whether or not remote URLs can be used by various file system functions, in order to access remote files. It is recommended security best practice nowadays ...
HappyDog's user avatar
  • 1,369
1 vote
1 answer
494 views

I have a long-running PHP script that seems to have a memory leak and that got me diving into how PHP garbage collection works. I had some questions about it and maybe there are some people on here ...
rbalik's user avatar
  • 93
0 votes
1 answer
90 views

I know that iteration over an object is equal to iterating over the visible properties of the class. class MyClass { public $var1 = 'value 1'; public $var2 = 'value 2'; public $var3 = '...
hoseinz3's user avatar
  • 648
0 votes
1 answer
270 views

While reading about PHP Zend Engine internals, I came across function zend_parse_parameters() which is used as the following if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &number) ...
Nadir's user avatar
  • 13
2 votes
0 answers
2k views

I am currently experiencing a problem with xdebug. I wanted to do a php bin/console cache:clear for my Symfony application but it got me this error: Warning: Xdebug MUST be loaded as a Zend ...
Lucatorze's user avatar
  • 107
3 votes
2 answers
397 views

In PHP, assuming $value = 12345;(an integer), which is faster when casting $value from an integer to a string; $value = (string)$value; or $value = "$value"; This is a kind of performance measure ...
Derick Alangi's user avatar
2 votes
2 answers
329 views

There is very efficient assoc. array C language implementation used in php source code. /* * HashTable Data Layout * ===================== * * +=============================+ * ...
legale's user avatar
  • 732
0 votes
0 answers
49 views

It's included in many files. For example: /* $Id: php_cli.c 306938 2011-01-01 02:17:06Z felipe $ */ Is this helping debug process or something else? Any tool related?
Gavin Kwok's user avatar
1 vote
2 answers
261 views

I have created an php extension in c++ which tracks the call graph of each request(centos7-64 bit,PHP5.6).And now,I want to get the function return value of each function. It can be done by using ...
Durai's user avatar
  • 87
2 votes
0 answers
215 views

I'm trying to port an old PHP extension of mine working for PHP 5.4 to PHP 7.3 (7.3.0 RC3 more precisely). I'm building the extension using Visual Studio 2017 on Windows 10 Pro x64, building both for ...
Carlo Pastorino's user avatar
2 votes
0 answers
178 views

When running PHP programs using mod_php, when does PHP call its extension's MINIT functions? Does this happen When the apache web server restarts? Whenever apache spins up a new thread pool to handle ...
Alana Storm's user avatar
0 votes
1 answer
741 views

I'm write simple extension with class definition extension.h zend_class_entry * ExampleClass_class; zend_class_entry * get_ExampleClass_class(); extension.c #include "php.h" #include "extension.h" ....
rjhdby's user avatar
  • 1,397
29 votes
0 answers
1k views

As a learning exercise, I'm trying to save the compiled state of a PHP file in order to execute it at a later time without having to go through zend_compile_file again. The first thing I did was ...
MyUsername112358's user avatar
0 votes
1 answer
143 views

I currently knows how Zend parse operators by reading the Zend/zend_language_parser.y file of php-src. But I'm very confusing about how variables are recognized. The Bison token is: %token <ast&...
Gavin Kwok's user avatar
0 votes
1 answer
699 views

I'm using PHP 7.2.8 on my laptop that runs on Windows 10 Home Single Language 64-bit Operating System I've installed PHP 7.2.8 on my laptop using the latest copy of XAMPP installer. I come across ...
PHPLover's user avatar
  • 13k

1
2 3 4 5 6