Re: [PHP-DEV] Schroedinger Objects

2005-08-25 Thread Andi Gutmans
Yep, the default for an instantiated object should be true (i.e. it's not null). Andi At 12:14 AM 8/25/2005, Marcus Boerger wrote: Hello Andi, in that case we are providing a default conversion, maybe like the old one? Or just always return 1 like we do in 5.0 ? marcus Thursday, August 25

Re: [PHP-DEV] Schroedinger Objects

2005-08-25 Thread Marcus Boerger
Hello Andi, in that case we are providing a default conversion, maybe like the old one? Or just always return 1 like we do in 5.0 ? marcus Thursday, August 25, 2005, 1:31:08 AM, you wrote: > Yep I think that's a good point. > Checking for cast is the right thing IMO. > At 02:45 PM 8/24/2005,

Re: [PHP-DEV] Schroedinger Objects

2005-08-24 Thread Andi Gutmans
Yep I think that's a good point. Checking for cast is the right thing IMO. At 02:45 PM 8/24/2005, Rasmus Lerdorf wrote: As per bug #34199 and as Rob points out, if($obj) and if(!$obj) are handled by different opcodes and these two opcodes are inconsistent in whether they call an object's cast_ob

Re: [PHP-DEV] Schroedinger Objects

2005-08-24 Thread Rasmus Lerdorf
> if(!$obj) results in a which calls convert_to_boolean() which in turn > calls convert_object_to_type() which has: I meant results in a ZEND_BOOL_NOT_SPEC_CV_HANDLER... -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Schroedinger Objects

2005-08-24 Thread Rasmus Lerdorf
As per bug #34199 and as Rob points out, if($obj) and if(!$obj) are handled by different opcodes and these two opcodes are inconsistent in whether they call an object's cast_object handler. if($obj) results in a ZEND_JMPZ_SPEC_CV_HANDLER which calls i_zend_is_true() which always return true for ob