Skip to main content

All Questions

Tagged with
0 votes
0 answers
94 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 ...
Vali's user avatar
  • 16
0 votes
1 answer
58 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 ...
omar mahmoud's user avatar
1 vote
0 answers
35 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....
tweekz's user avatar
  • 338
1 vote
0 answers
267 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....
Brett McBride's user avatar
4 votes
0 answers
268 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 ...
Fuze's user avatar
  • 113
2 votes
0 answers
174 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 ...
Bloops's user avatar
  • 754
4 votes
1 answer
266 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 ...
cachius's user avatar
  • 1,877
0 votes
0 answers
424 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? ...
chaitanya's user avatar
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 ...
HappyDog's user avatar
  • 1,283
4 votes
0 answers
320 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 ...
Smuuf's user avatar
  • 6,475
1 vote
1 answer
508 views

What are the limits on session names in PHP?

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
  • 37k
2 votes
0 answers
341 views

how to allocate & deallocate memory in php?

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
507 views

How can I overwrite an internal Zend function with a PHP extension?

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
77 views

Passing HashTable data from php.ini to an extension method: corrupted values

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
4 votes
1 answer
700 views

Why does php allow invalid return type declerations it knows it can't allow?

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

15 30 50 per page
1
2 3 4 5
16