Re: [PHP4BETA] propose for bool -> string conversion:
| From: | bourbon at netvision dot net dot il | Date: | Fri, 02 Jul 1999 13:38:43 +0000 |
| Subject: | Re: [PHP4BETA] propose for bool -> string conversion: | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-1804@lists.php.net to get a copy of this message | ||
On Fri, 2 Jul 1999, Rasmus Lerdorf wrote:
> > So they're buggy functions. 0 is just as much as false as "" or
> > "0" are.
>
> Whether that is true or not is not really the point. They are out there
> and people are using them. And since our strings are indexed starting
> from 0, a function that returns the string index of a character at the
> first position in a string would logically return 0.
Well, changing this behavior isn't difficult, as Thies pointed out.
Nonetheless, when these functions were written, it was wrong for them to
assume 0 is not the same as false, because by the language definition, it
is. It shouldn't have even been an option to use 0 and false as two
different return values.
Zeev
--
-----------------------------------------------------
Zeev Suraski <zeev@zend.com>
For a PGP public key, finger bourbon@netvision.net.il