Re: [PHP-DEV] Question about `global` variable declaration

2019-09-21 Thread Zeev Suraski
On Sat, Sep 21, 2019 at 6:18 PM Kosit Supanyo wrote: > Unlike var, public, static and others - 'global' is not a declaration of >> class structure, but a way to access global variables. > > > I know it is not and I think almost everyone knows that. As I said, I came > up with this by comparing

Re: [PHP-DEV] Improving productivity of internals mailing list

2019-09-21 Thread Rowan Tommins
On 21 September 2019 12:18:20 BST, Dan Ackroyd wrote: >On Fri, 20 Sep 2019 at 19:52, Rowan Tommins >wrote: >> >> I think we should be making that volume easy to work with, not trying >to reduce it as an end itself. > >As I've said elsewhere, I think having a central place for people to >find

Re: [PHP-DEV] Question about `global` variable declaration

2019-09-21 Thread Kosit Supanyo
> > Unlike var, public, static and others - 'global' is not a declaration of > class structure, but a way to access global variables. I know it is not and I think almost everyone knows that. As I said, I came up with this by comparing to other declarations syntactically not functionally, it is

Re: [PHP-DEV] Question about `global` variable declaration

2019-09-21 Thread Zeev Suraski
On Sat, Sep 21, 2019 at 3:09 PM Kosit Supanyo wrote: > I understand your point but inconsistency in my sense is syntactical By > comparing to other declaration syntax like `var`, `static`, 'public` an > others. They allow only T_VARIABLE but `global` is different. And there's > another way to

Re: [PHP-DEV] Question about `global` variable declaration

2019-09-21 Thread Kosit Supanyo
I understand your point but inconsistency in my sense is syntactical By comparing to other declaration syntax like `var`, `static`, 'public` an others. They allow only T_VARIABLE but `global` is different. And there's another way to archive the same goal through `$GLOBALS`, that's why I see it as

Re: [PHP-DEV] Question about `global` variable declaration

2019-09-21 Thread Nikita Popov
On Sat, Sep 21, 2019 at 12:58 PM Kosit Supanyo wrote: > Hi Dan and Internals > > Sorry Dan, I forgot to include @Internals in previous reply so let me > resend this again. > > Thank you for your reply. I see, but in that case it can be done with > `$GLOBALS['abc']` right? So I don't see any

Re: [PHP-DEV] Improving productivity of internals mailing list

2019-09-21 Thread Dan Ackroyd
On Fri, 20 Sep 2019 at 19:52, Rowan Tommins wrote: > > I think we should be making that volume easy to work with, not trying to > reduce it as an end itself. As I've said elsewhere, I think having a central place for people to find interesting conversations/things to work on, would help direct

Re: [PHP-DEV] Question about `global` variable declaration

2019-09-21 Thread Kosit Supanyo
Hi Dan and Internals Sorry Dan, I forgot to include @Internals in previous reply so let me resend this again. Thank you for your reply. I see, but in that case it can be done with `$GLOBALS['abc']` right? So I don't see any benefits of allowing those forms, they're just another inconsistency

Re: [PHP-DEV] Question about `global` variable declaration

2019-09-21 Thread Nikita Popov
On Sat, Sep 21, 2019 at 11:56 AM Kosit Supanyo wrote: > 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, >

Re: [PHP-DEV] Question about `global` variable declaration

2019-09-21 Thread Dan Ackroyd
Hi Kosit, On Sat, 21 Sep 2019 at 10:56, Kosit Supanyo wrote: > > global $$x; > global $$$y; > global z; > global ${'abc'}; > global $${random_int(0, PHP_INT_MAX)}; I have found the form `global ${'abc'};` useful in the past to work around the limits on what PHP can parse as variable

[PHP-DEV] Question about `global` variable declaration

2019-09-21 Thread Kosit Supanyo
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...