propose for bool -> string conversion:
| From: | Thies C. Arntzen | Date: | Fri, 02 Jul 1999 12:10:24 +0000 |
| Subject: | propose for bool -> string conversion: | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1785@lists.php.net to get a copy of this message | ||
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")
tc
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