270 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
86
views
How to make a custom function called whenever a method of the PDO class is invoked
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 ...
0
votes
1
answer
75
views
Why hashtable (array implementation) compaction does not kick in in PHP?
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 ...
0
votes
0
answers
127
views
Adding new reference to any item in array affects behaviour of the array
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 ...
0
votes
1
answer
77
views
in php programming where is the array data and the address being stored?
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 ...
1
vote
0
answers
50
views
Are PHP zvals mutable?
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....
0
votes
0
answers
30
views
Is there an opcode in PHP VM that lets you stack allocate?
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?
1
vote
0
answers
315
views
How to create a php extension function with a return type-hint plus annotation
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....
1
vote
1
answer
306
views
How do I add a new opcode to PHP?
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 ...
4
votes
0
answers
320
views
PHP5 zval container vs PHP7 zval container. How references & variables are stored now?
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 ...
2
votes
0
answers
209
views
How to call a PHP function from zend_compile.c?
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 ...
0
votes
1
answer
231
views
Why the macro "ZVAL_COPY_VALUE(z,v)" seems to work unexpectedly in PHP Internal?
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 ...
4
votes
1
answer
294
views
Where is PHP echo implemented in the source?
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 ...
0
votes
0
answers
465
views
PHP memory limit -1 unlinimited
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? ...
9
votes
1
answer
3k
views
What was PHP's "o" serialization format for?
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 ...
4
votes
1
answer
483
views
What userland strings get automatically interned by PHP?
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 ...