While working with ESP8266, one of the ways to debug code is to print data to the serial monitor when ESP8266 is connected via USB to a PC. However, there...
The token_get_all function parses PHP source code and returns an array of tokens. Each token is represented either as a single character or an array that contains token ID, token...
Cross-compilation is a process when source code is compiled into executable code on one platform and will run on another platform. For example, a program was compiled on 64-bit PC...
PHP has the switch statement that can be used to execute different blocks of code based on different cases. Since PHP 8.0, we can use the match expression that is...
The final keyword is related to inheritance concept in object-oriented programming (OOP). Inheritance is a process when a child class inherits properties and behavior from the parent class. The final...
The final keyword can be applied to class methods. When a parent class has a method that declared as final, then child classes cannot override this method.
Private methods cannot...
The ternary (?:) operator is a conditional operator that allows to shorten if/else structures and decrease the length of code. The syntax for ternary operator can be represented as follows:...
Composer is a dependency management tool for PHP that allows to specify libraries on which project depends on. Composer manages libraries installation and update per-project (the default) or globally.
This...
Environment variable is a named value on a computer that can be used to affect running processes. Programming languages provides methods to set an environment variable. A table includes a...
PHP allows defining constants using define function. Defined constants are case-sensitive. For example, DB_USER and db_user represents different constants.
In versions prior to PHP 8.0, it was possible to define...