Multiple Inheritance in PHP - a workaround
It is well known that PHP doesn't offer multiple inheritance, instead it provides interfaces. Altough the interfaces are something very good they can not fully replace the multiple inheritance. Of course some people voice opinions that if you need multiple inheritance then the design of the application is wrong - this will not be covered here. Instead we will investigate what are the...
Tags: How to... PHP 5.3 PHP General Tips and Tricks
Continue reading...New objects and value assignment
In PHP 4 was possible the constructor to return a value (different from the object). Here is a simple example how this would work in PHP 4: Of course this does not work in PHP 5.3 - first it will throw an error on the $this assignment, second - in PHP 5.3 the new operator always returns an object. In PHP 5 the constructor can be interrupted by throwing an exception and this will prevent the...
Tags: PHP General Tips and Tricks
Continue reading...Mirror, mirror, on the wall… what is this Reflection for?
In PHP 5.0 the Reflection extension was introduced. It is not kind of the usual extensions for manipulating or retreiving some sort of data, it is not adding support for a new protocol, it is something much more different and much more important (which is reflected in its documentation being placed under “Variables and Type Related Extensions“). This extension gives the possibility php code to...
Tags: How to... PHP General
Continue reading...