PHP Programming/Reserved words

From Wikibooks, open books for an open world
Jump to navigation Jump to search


PHP words[edit | edit source]

List of the 72 reserved words by alphabetical order:

__CLASS__ 
__DIR__
__FILE__ 
__FUNCTION__ 
__LINE__ 
__METHOD__ 
__NAMESPACE__
abstract
and 
array() 
as 
break 
case 
catch
cfunction ''(PHP 4)''
class 
clone
const 
continue 
declare 
default 
die() 
do 
echo() 
else 
elseif 
empty() 
enddeclare 
endfor 
endforeach 
endif 
endswitch 
endwhile 
eval() 
exit()
explode()
extends 
final
for 
foreach 
function 
global 
goto
if 
implements
include_once() 
include() 
instanceof
interface
isset() 
list() 
namespace
new 
old_function ''(PHP 4)''
or 
print() 
private
protected
public
require_once() 
require() 
return() 
split() ''(PHP < 5.3)''
static 
switch 
throw
try
unset() 
use 
var 
while 
xor

PHP7 news[edit | edit source]

Several composed operators can reduce the usual syntax:

  • ??: null coalescing operator. Equivalent to a ternary operator with an is_null().
  • <=>: spaceship operator. Equivalent to a switch with three cases: inferior, equal and superior.
  • intdiv(): integer division. Equivalent to / + intval().

Moreover, we can now use:

  • several classes in the same use declaration.
  • define() to set an array of constants.

Extensions[edit | edit source]

List of the 48 native PHP 5.5.0 libraries with EasyPHP:

Core
PDO
Phar
Reflection
SPL
SimpleXML
apache2handler
bcmath
bz2
calendar
ctype
curl
date
dom
ereg
filter
ftp
gd
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
odbc
openssl
pcre
pdo_mysql
pdo_sqlite
pdo_sqlsrv
session
sockets
sqlite3
sqlsrv
standard
tokenizer
wddx
xdebug
xml
xmlreader
xmlwriter
xsl
zip
zlib