Closed Porlockzzz closed 1 year ago
Please don't use screenshots for text when possible, it's not cool for a lot of people (blind users, terminal users, …)
There is no bug here.
The "referenceness" is not checked/done through the opcode, but instead this is part of the function signature. An op array contains for each argument "arg_info_flags" which contains which type the argument is supposed to be, and also whether it is a reference or a variadic.
VLD does not show this information to go with each function (oparray) yet.
Please don't use screenshots for text when possible, it's not cool for a lot of people (blind users, terminal users, …)
Thanks for the reminder!
There is no bug here.
The "referenceness" is not checked/done through the opcode, but instead this is part of the function signature. An op array contains for each argument "arg_info_flags" which contains which type the argument is supposed to be, and also whether it is a reference or a variadic.
- https://github.com/php/php-src/blob/PHP-8.2/Zend/zend_compile.c#L6881
- https://github.com/php/php-src/blob/PHP-8.2/Zend/zend_compile.c#L6956
VLD does not show this information to go with each function (oparray) yet.
Thanks!
I'm interested in PHP opcode, when I use VLD to analyze a case, I found some interesting. Below is the code for this case, these are two PHP files: main.php and include.php
Absolutely, after main.php execution, we get a different value for $var1 and $var2. But, when I check the opcode, I found that the opcodes for function sendref and function sendnoref are the same.
And for main.php, it seems that the opcode for the function call is the same too.
So, I want to know why we get a different value for $var1 and $var2 when the opcodes are the same.