Re: Re: Question about constructors and destructors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I tested on linux also and found no problem ...

Mathieu Dumoulin wrote:
> For all to know
> 
> This bug is linux AND windows, the problem is caused when you have the
> 
> zend.ze1_compatibility_mode = On

now it makes sense ... someone else offered a pretty good explanation
as to why you see the 'buggy' behaviour.

I'll go out on a limb and say that the 'bug' will likely never be fixed,
assuming it even should be (the behaviour seems to me to be consistent
with php4 OO functionality - namely passing objects by value)

zend.ze1_compatibility_mode is next to useless in practice for anything
but the most simple php4 OO code. certainly if you are wanting to
use php5 specific OO functionality like __destruct() you should not be using
ze1_compatibility_mode.

> 
> in the php.ini file. This is a bug that was reported before several
> times without having been resolved. I commented and reactiveated the bug
> on the php bug submission engine...
> 
> Thanks all for your support
> 
> Math
> 
> Mathieu Dumoulin wrote:
>> I posted a bit earlier and did some other tests and now i have a VERY
>> simple question... check the following code :
>>
>> =======================================
>>
>> class test {
>>     public function __construct(){
>>         echo 'Building<br>';
>>     }
>>     public function __destruct(){
>>         echo 'Destroying<br>';
>>     }
>> }
>>
>> echo 'Will build<br>';
>> $mytest = new test();
>> echo 'Finished building<br>';
>>
>> echo 'Unseting<br>';
>> unset($mytest);
>> echo 'Unset complete<br>';
>>
>> =======================================
>>
>> Althought you may think this will give the following output:
>>
>> Will build
>> Building
>> Finished building
>> Unseting
>> Destroying
>> Unset complete
>>
>> Instead it outputs the following:
>>
>> Will build
>> Building
>> Destroying
>> Finished building
>> Unseting
>> Destroying
>> Unset complete
>>
>> Notice the "Destroying" right after the building? Is that normal
>> behavior, i just updated to PHP 5.1.4 for windows and IMO its not
>> normal, can anyone test this on PHP 5 for linux see if it's only a
>> windows issue!!!!
>>
>> This is really important thanks
>>
>> Math
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux