Closed
Description
Description
Create /var/www/html/test.php
with:
<?php
assert(false && new class {
public function __construct() {}
} );
And then
- start gdb
- input
set print pretty on
- add breakpoint
break /usr/src/php/Zend/zend_compile.c:4356
This corresponds toLines 4354 to 4357 in 65d4331
- run the script,
run /var/www/html/test.php
- examine the AST for args (raw) with
p /r *args->child[0]->child[1]
Output:
$1 = {
kind = 527,
attr = 0,
lineno = 3,
child = {0x7ffff3262150}
}
- try to use the pretty printer,
p *args->child[0]->child[1]
Resulted in this output:
$2 = ((zend_ast*)0x7ffff3203118) = {
kind = ZEND_AST_NEW,
attr = 0,
lineno = 3,
child[0] = ((zend_ast_decl*)0x7ffff3262150) = {
kind = ZEND_AST_CLASS,
attr = 0Python Exception <class 'gdb.error'>: There is no member named start_lineno.
...
},
child[1] = ((zend_ast_list*)0x7ffff3202d70) = {
kind = ZEND_AST_ARG_LIST,
attr = 0,
lineno = 3Python Exception <class 'gdb.error'>: There is no member named children.
...
}
}
But I expected this output instead:
[no exceptions]
PHP Version
Operating System
No response