Unique Features of PHP
PHP language has support features of other languages like c, Perl and etc. It also has some unique features of it’s own. Some of them are listed below in this article.
- In PHP there is no need to specify data type for variable declaration. Rather, it can be determined at the time of execution depends on the value of the variable. So that, PHP is called as loosely typed language.
- PHP provides cross platform compatibility, unlike some other server side scripting language.
- PHP has set of pre defined variables called superglobals which will be start by _. Some of the examples are, $_GET, $_POST, $_COOKIE, $_SESSION, $_SERVER and etc. So, any variable except superglobals, that are start with _ will cause error.
- PHP programming structure includes variable variables; that is, the name of the variable can be change dynamically.
- This language contains access monitoring capability to create logs as the summary of recent accesses.
- And then, it includes several magic methods that begins with __ character which will be defined and called at appropriate instance. For example, __clone() will be called, when the clone keyword is used.
- Predefined error reporting constants are available to generate a warning or error notice. For example, when E_STRICT is enabled, a warning about deprecated methods will be generated.
- PHP supports extended regular expression that leads extensive pattern matching with remarkable speed.
- And then, properties like, nowdocs and heredocs are used to delimit some block of context which should not be sent for parsing.
- Since PHP is a single inheritance language, the parent class methods can be derived by only one directly inherited sub class. But, the implementation of traits concept, reduce the gap over this limitation and allow to reuse required method in several classes.
This PHP code tutorial was published on April 14, 2013.
↑ Back to Top