Questions tagged [php-internals]

How the PHP programming language works underneath, and questions about the underlying C code.

PHP Internals

Tag purpose

The purpose of the tag is to indicate a question about the internals of PHP. Possible questions could be about how references counting or copy on write. E.g. When you want to know what happens under the hood while doing things in PHP. It can also be applied to questions in the tag that deal with extending PHP at the core. This tag should also be used for any questions about the Zend Engine powering PHP.


External Links

269 questions
0
votes
1 answer

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 not found the answer . I used bard to find the…
0
votes
1 answer

php extension method not returned why?

Here is the php_ex.cc . When I compile my .so library the retur() method is not working. WHY? I have no errors, but It should print "test" and it doesn;t . need some help.THX [php_ex.cc] #include "php_vehicles.h" #include…
sunset
  • 1,359
  • 5
  • 22
  • 35
0
votes
0 answers

How do I inspect the opcode output of use-statements in PHP?

Using phpdbg -p* tmp.php on code
Olle Härstedt
  • 3,799
  • 1
  • 24
  • 57
0
votes
0 answers

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?
Olle Härstedt
  • 3,799
  • 1
  • 24
  • 57
0
votes
1 answer

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 string, however it indeed updated successfully by GDB…
phpmooc
  • 33
  • 7
0
votes
0 answers

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? What is default memory allocated ? How it…
0
votes
1 answer

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 PHP_MINIT_FUNCTION(myext). So, I declared a php…
Alexander Mashin
  • 3,892
  • 1
  • 9
  • 15
0
votes
1 answer

Are `zval *retval` argument and the `zval *` return value of the `zend_call_method` the same?

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 grepping the source directory for its definition, but…
Joyce Babu
  • 19,602
  • 13
  • 62
  • 97
0
votes
1 answer

Segfault Error when using zend_call_function()

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 values from the __construct arguments and printing…
AKJ
  • 950
  • 2
  • 13
  • 18
0
votes
1 answer

Is there a way in php to count the nested stucture level?

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 entered. I'll call it NESTING with in the…
Philipp
  • 137
  • 1
  • 2
  • 11
0
votes
0 answers

PHP API Reflection

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 the formation of an error pattern "must be an…
0
votes
0 answers

Tag a data to curl HTTP request in PHP C++ extension

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 request is made to another PHP web application, I need…
Sel_va
  • 588
  • 5
  • 25
0
votes
1 answer

Object Iteration

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 = 'value 3'; protected $protected = 'protected…
hoseinz3
  • 618
  • 4
  • 13
0
votes
1 answer

How to read this function in C?

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) != SUCCESS) { return; } I am confused about the…
Nadir
  • 13
  • 1
  • 5
0
votes
0 answers

what is the functionality of `/* $Id$ */` in php-src files

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
  • 98
  • 6