PHP language reference

PHP built-in language features chapter.


PHP supports multiple types


Variables are used to store some value in your program.


Constants are similar to variables except they can be defined only once and cannot be chanded anymore during the program execution.


Operator is language element that takes one or more values and yields another value.

Control structures

Control structures are essential part of any language. They control how the program flow is happening, manage logic and more.


Functions wrap a block of code and provide reusability of this code in different parts of your program.

Object oriented programming

Object oriented programming with PHP, design patterns and anti patterns.


Namespaces are advanced way of encapsulating program items. Learn more about namespaces in PHP and how to use them.


How to show and handle errors in PHP.


Exceptions are object oriented events that occur in program execution.


Generators implement iterators.


References in PHP are symbol table aliases for accessing same variable by different names.

Predefined variables

PHP provides some special variables.


PHP cheatsheet of all basic built-in features and its basic syntax presented again in a single all-in-one chapter.

Found a typo? Something wrong with this content?

Just fork and edit it.

Content of this work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license. Code snippets in examples are published under the CC0 1.0 Universal (CC0 1.0). Thanks to all contributors.