Re: Class constructor
| From: | Andrei | Date: | Tue, 31 Jan 2006 13:53:38 +0000 |
| Subject: | Re: Class constructor | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-229544@lists.php.net to get a copy of this message | ||
You could try with phpversion().
Georgi Ivanov wrote:
Hi, I'm writing a simple class. In order to be compatible with php4 and php5 I've done this : class test{ function Test(){ //This will be called in PHP4 } function __construct(){ //This will be called in PHP5 $this->Test(); } } Is this a solution ? Is there a better way ? Thanks.