One of the problem of PHP as a OOP language is, the fact that you can only have single inheritance. This means your class can only inherit from one other class. PHP Traits (new feature was added in PHP 5.4) is kind of like a Mixin, allows you to mix Trait classes into an…
Object cloning or clone of an object means to create a duplicate of an object. With regular variables $var1 = $var2 means that a new variable $var1 created and have the value of $var2 that means 2 variables created. With objects $obj2 = $obj1 does not mean that a new object i.e. $obj2 get…
PHP Magic Predefined Constants & usages In PHP, a constant is a name or an identifier for a simple value. A constant name starts with a letter or underscore can be followed by any number of letters, numbers, or underscores. If you have defined a constant, it can never be changed or undefined. You…
Magic Methods in PHP (PHP Magical Reserved Functions Starts with double underscore) According to me you all have heard about the PHP Magic methods. You have also used some of these like __autoload and __construct. Let’s have a quick view on magic methods, as sometimes it looks like it will hard to use these…
Search Engine Spider and User Agent Identification with “Ultimate User Agent Blacklist” A user-agent is software (a software agent) that is acting on behalf of a user. In many cases, a user-agent acts as a client in a network protocol used in communications within a client–server distributed computing system. For more information view…
Polymorphism – the concept Polymorphism is a Greek word that means “many forms”. In object-oriented programming, polymorphism is a mechanism by which objects of different types can process data through a single interface. Using a typical illustrative example, a program might define a type of object called Animal, containing a function called talk() and,…