Questions tagged [php-internals]
How the PHP programming language works underneath, and questions about the underlying C code.
php-internals
268
questions
29
votes
0
answers
1k
views
Pre-compiling PHP files [closed]
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 ...
0
votes
1
answer
115
views
How does Zend recognize a variable by specify the dollar prefix when parse it?
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&...
0
votes
1
answer
671
views
What do exactly mean by "PHP compilation options"?
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 ...
0
votes
0
answers
26
views
Where the CGI is engaged in Zend Engine code compiling [duplicate]
I am trying to get deeper in the zend engine and the whole server processes at all
and from what I understood is - when I send a request to the server, the Zend Engine first engages the scanning\...
-1
votes
1
answer
34
views
PHP Double comparision
PHP Version 7.1.7 / Laravel 5.4
dump($this_tour->payments_to_operator_sum());
1012.0
dump(gettype($this_tour->payments_to_operator_sum()));
"double"
dump($this_tour->operator_price, ...
2
votes
1
answer
84
views
PHP Internals: Where are Arrays Created
What code in the php-src repo handles a PHP programmer creating an array?
That is -- as a PHP programmer I might do something like this
$foo = array();
$foo = [];
Behind the scenes, I assume there'...
0
votes
0
answers
54
views
Reads the Value from zval* in separate thread - PHP extension c++
I am using Centos 7 (PHP - 5.6.36 Thread safety - disabled) i have created PHP extension in c++ to store the function call stack traces.
Storing the information starts from PHP_RINIT_FUNCTION and end ...
10
votes
3
answers
599
views
What are the functions PHP which are said not to be "binary safe"? To which libraries these "non-binary safe" functions hand off the strings? And why?
I'm using Windows 10 Home Single Language Edition which is a 64-bit Operating System on my machine.
I've installed the most latest version of XAMPP which has installed PHP 7.2.7 on my machine.
I'm ...
-4
votes
1
answer
143
views
Is the PHP Manual misguiding regarding the output of 'phpinfo()' function?
I'm using Windows 10 Home Single Language Edition which is a 64-bit Operating System on my machine.
I've installed the most latest version of XAMPP which has installed PHP 7.2.6 on my machine.
I ...
1
vote
1
answer
75
views
File write not working in PHP extension c/c++ (linux)
I have created my own PHP extension in c++ (linux).
when zend engine compiles the PHP code am getting the active user functions and internal functions name.
To debug this php extension am using ...
7
votes
1
answer
878
views
Why `mysqli_query()` returns null? How can i figure it out?
Under certain circumstances, the built-in function in PHP called mysqli_query returns null. Such behaviour is not foreseen by the function's documentation that explains how to use it, so I tried to ...
2
votes
1
answer
131
views
How to get a function args when I hooked it in a php7.0 exetension
I tried to write a php extension to get function args.
<?php system('ls');?>
In this example is 'ls'.
I hooked this function with zend_set_user_opcode_handler, and the function codes are.
...
9
votes
3
answers
620
views
how to check php function source code using eclipse
I'm curious on how certain php functions are implemented internally. e.g. array_values().
So in eclipse, I control click on the function name, which took me to a page that contain function prototype ...
9
votes
1
answer
139
views
What is the reasoning behind the refusal of PHP to accept the return types in this simple situation?
In PHP 7.1.4, using strict typing, I have a simple object oriented setup involving some interfaces, and some classes implementing those interfaces. Below example, as you would expect, works fine.
...
1
vote
1
answer
393
views
Why does var_dump(debug_backtrace()) within a method triggers object's __debugInfo()?
Could someone explain me why in the following case:
class A {
public function methodA() {
var_dump(debug_backtrace());
}
public function __debugInfo() {
return [];
}
...