Re: Exceptions and Errors

From: Date: Thu, 15 Apr 2004 12:40:02 +0000
Subject: Re: Exceptions and Errors
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  Groups: php.internals 
Request: Send a blank email to internals+get-9180@lists.php.net to get a copy of this message
Lukas Smith wrote:
Our original idea was to handle this with an if statement like so: if (version_compare(phpversion(), "5.0.0") == -1) {
    // assign factoried method to this for PHP 4
    // $this =& <Your_Package_Name>::factory();
    $this =& <Your_Package_Name>::singleton();
} else {
    // error handling for PHP5
    // user has to use the factory()/singleton() method
}
I guess to make it clear, what I want is that PHP5 only explodes if it is actually asked to execute an assignement to $this and not just because there is one in the constructor. However Derick just messed around with the relevant code and didnt immediatly see a solution. regards, Lukas Smith

« previous php.internals (#9180) next »