PHP is the most popular server programming language.
PHP is powering the backend for some of the most famous websites, including Moodle, Facebook, Wikipedia, WordPress, Yahoo, and Slack!
According to (Adams k, 2016), PHP originally stood for Personal Home Page in 1995.
Adams K. (2016). also mentioned some of PHP’s characteristics that made it suitable for big players:
State isolation, each request is isolated from the others and gets its own copy of the state. So if a request was faulty, it would not affect the other requests.
PHP opens a thread per request, so it can handle multiple requests simultaneously, and most importantly, each request execution is 100% isolated from the others.
No need to restart the server after a change in the code, which makes it easy to act quickly to bugs and security issues.
Object Oriented Programming was introduced in PHP 3; in 1998.
PHP now includes a complete object model that allows you to develop complex applications more efficiently.
Some of OOP features include:
Property and Method visibility modifiers: public, private, protected, final, and static.
Class constants: const keyword allows you to define constants inside a class, which can be accessed as a static property. using self::CONSTANT_NAME of ClassName::CONSTANT_NAME.
Class auto-loaders: functions that can be called to loaded to load classes automatically at the beginning of the script (request), reducing the number of import statements.
Destructor: a method that is called when an object is destroyed.
Inheritance: PHP supports single inheritance, meaning a class can only inherit from one parent class. Private and protected members of the parent class are not inherited.
Abstract classes: classes that cannot be instantiated but can be extended.
Interfaces: a way to specify what methods a class should implement.
The spaceship operator <=> returns an integer less than, equal to, or greater than zero when the first operand is respectively less than, equal to, or greater than the second operand.