Re: [PHP4BETA] propose for bool -> string conversion:

From: Date: Fri, 02 Jul 1999 12:28:00 +0000
Subject: Re: [PHP4BETA] propose for bool -> string conversion:
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-1789@lists.php.net to get a copy of this message
zeev, to be quite honest i'm not even that sure that it's good to have <? $var = false; echo "<".$var.">\n"; ?> to print: <false> i'd prefer it to print: <> cause who want's to see "false" in their output? tc On Fri, 2 Jul 1999 bourbon@netvision.net.il wrote: > On Fri, 2 Jul 1999, Thies C. Arntzen wrote: > > > diff -w -u -r1.14 zend_operators.c > > --- zend_operators.c 1999/06/26 11:48:22 1.14 > > +++ zend_operators.c 1999/07/02 12:08:46 > > @@ -287,8 +287,13 @@ > > case IS_STRING: > > break; > > case IS_BOOL: > > - op->value.str.val = > > (op->value.lval?estrndup("1",1):estrndup("0",1)); > > + if (op->value.lval) { > > + op->value.str.val = estrndup("1",1); > > op->value.str.len = 1; > > + } else { > > + op->value.str.val = empty_string; > > + op->value.str.len = 0; > > + } > > break; > > case IS_LONG: > > lval = op->value.lval; > > > > this patch will get us the "good old php3 behaviour" back: > > > > true -> "1" > > false -> "" (instead of "0") > > Why does it matter? > > Zeev > > -- > ----------------------------------------------------- > Zeev Suraski <zeev@zend.com> > For a PGP public key, finger bourbon@netvision.net.il > > > Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany

« previous php.version4 (#1789) next »