Posted by Justin Koivisto on 02/13/06 19:53
Schraalhans Keukenmeester wrote:
> Hi
>
> Since PHP5 classes use the __constructor() method, and PHP4 still
> requires the classname as constructor, is there an easy way to
> incorporate both in my class definitions so the class is usable in both
> versions?
>
> I know php5 will look for an old style constructor if there is no
> __constructor definition, but I am convinced this will be deprecated in
> future versions...
You could try doing something like:
class MyClass {
function __construct () {
$this->MyClass ();
}
}
I am personally starting to move over to PHP5 breaking PHP4 compat. ;)
--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
[Back to original message]
|