Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_object_handlers.c

From: Date: Fri, 07 Oct 2005 07:46:33 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_object_handlers.c
References: 1 2  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4214@lists.php.net to get a copy of this message
Hello Dmitry, didn't we change the boolean part lately to support BC? And well boolean->true makes pretty much sense to me and in the same manner for php's autoconversion behavior we should have int/float return 1 as well. The boolean converson is very often used as short form of "$obj !== NULL" or "!is_null($obj)". But i really only care for strings here. marcus Friday, October 7, 2005, 8:55:54 AM, you wrote: > Shouldn't we casre about ze1_compatibility_mode here? > Or will we remove it at all? > PHP4 returned true only if object had properties. > Dmitry. >> -----Original Message----- >> From: Marcus Boerger [mailto:helly@php.net] >> Sent: Thursday, October 06, 2005 10:46 PM >> To: zend-engine-cvs@lists.php.net >> Subject: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_object_handlers.c >> >> >> helly Thu Oct 6 14:46:02 2005 EDT >> >> Modified files: >> /ZendEngine2 zend_object_handlers.c >> Log: >> - Any php object converts to boolean as true >> >> >> http://cvs.php.net/diff.php/ZendEngine2/zend_object_handlers.c > ?r1=1.148&r2=1.149&ty=u > Index: ZendEngine2/zend_object_handlers.c > diff -u ZendEngine2/zend_object_handlers.c:1.148 > ZendEngine2/zend_object_handlers.c:1.149 > --- ZendEngine2/zend_object_handlers.c:1.148 Wed Oct 5 15:02:27 2005 > +++ ZendEngine2/zend_object_handlers.c Thu Oct 6 14:46:01 2005 > @@ -17,7 +17,7 @@ > +----------------------------------------------------------------------+ > */ > > -/* $Id: zend_object_handlers.c,v 1.148 2005/10/05 19:02:27 helly Exp $ */ > +/* $Id: zend_object_handlers.c,v 1.149 2005/10/06 18:46:01 helly Exp $ > +*/ > > #include "zend.h" > #include "zend_globals.h" > @@ -1038,6 +1038,10 @@ > } > } > return FAILURE; > + case IS_BOOL: > + INIT_PZVAL(writeobj); > + ZVAL_BOOL(writeobj, 1); > + return SUCCESS; > default: > break; > } Best regards, Marcus

« previous php.zend-engine.cvs (#4214) next »