Re: [PHP4BETA] propose for bool -> string conversion:
| From: | bourbon at netvision dot net dot il | Date: | Fri, 02 Jul 1999 12:14:26 +0000 |
| Subject: | Re: [PHP4BETA] propose for bool -> string conversion: | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-1786@lists.php.net to get a copy of this message | ||
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