solvit.io

List of PHP keywords and reserved words

PHP 5.x
All PHP 5 versions
__halt_compiler() abstract and array() as
break case catch class clone
const continue declare default die()
do echo else elseif empty()
enddeclare endfor endforeach endif endswitch
endwhile eval() exit() extends final
for foreach function global if
implements include include_once instanceof interface
isset() list() new or print
private protected public require require_once
return static switch throw try
unset() use var while xor
PHP 5.3 and higher
goto() namespace
PHP 5.4 and higher
callable insteadof trait
PHP 5.5 and higher
finally yield
PHP 7.x

All the above keywords can be safely used as property, constant and method names of classes, interfaces and traits (except class, which cannot be used as a constant name).

Find more solutions about: ,