You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Presently, empty(), eval(), exit(), isset(), list(), unset() are recognized as functions because of braces. But __halt_compiler(), array(), die(), empty(), eval(), exit(), isset(), list(), unset() are not functions: they are keywords.
Depending on your decision, I can make a PR with the appropriate RegExp. An example:
It's a good idea to update the PHP keyword. I think we can copy the keyword list you linked to as is (including empty, eval, and so on).
Regex looks good (sans the PHP 4 keywords). I'm looking forward to the PR.
remove cfunction or add old_function. Both are defined in PHP 4 only.
I think it's ok to remove the keywords of a PHP version for which support has ended a decade ago.
Is it alright to arrange keywords in alphabetical order? Is there a meaning in the current order? Is it connected with optimization?
Alphabetic order is very much appreciated because it makes it easy to spot missing/duplicate keyword (yes, that happens). Apart from that, the order doesn't matter in this case.
Here are some suggestions:
__halt_compiler
,callable
,clone
,empty
,eval
,exit
,insteadof
,isset
,list
,unset
. See https://secure.php.net/manual/en/reserved.keywords.php;cfunction
or addold_function
. Both are defined in PHP 4 only. See https://web.archive.org/web/20090122062341/http://php.net/manual/en/reserved.keywords.php.Presently,
empty()
,eval()
,exit()
,isset()
,list()
,unset()
are recognized as functions because of braces. But__halt_compiler()
,array()
,die()
,empty()
,eval()
,exit()
,isset()
,list()
,unset()
are not functions: they are keywords.Depending on your decision, I can make a PR with the appropriate RegExp. An example:
/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|null|old_function|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i
Is it alright to arrange keywords in alphabetical order? Is there a meaning in the current order? Is it connected with optimization?
I also have suggestions regarding
null
andparent
, but it’s better to start a separate topic for that.The text was updated successfully, but these errors were encountered: