Tuesday, 21 July 2015

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.
php_unique_features
  1. 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.
  2. PHP provides cross platform compatibility, unlike some other server side scripting language.
  3. 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.
  4. PHP programming structure includes variable variables; that is, the name of the variable can be change dynamically.
  5. This language contains access monitoring capability to create logs as the summary of recent accesses.
  6. 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.
  7. 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.
  8. PHP supports extended regular expression that leads extensive pattern matching with remarkable speed.
  9. And then, properties like, nowdocs and heredocs are used to delimit some block of context which should not be sent for parsing.
  10. 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.

0 comments:

Post a Comment