Hi Internals

I'm working on my new proposals and I've found weirdness of global variable
declaration in zend_language_parser.y.

global_var:
    simple_variable
        { $$ = zend_ast_create(ZEND_AST_GLOBAL,
zend_ast_create(ZEND_AST_VAR, $1)); }
;

Above grammer allows something like this...

global $$x;
global $$$y;
global $$$$z;
global ${'abc'};
global $$$$$$$$$${random_int(0, PHP_INT_MAX)};

What's the propose of allowing this? And is there anyone out there knowing
and using it? If not, should this be changed to allow only T_VARIABLE to
make it consistent with `static` variable declaration?

Regards

Reply via email to