Re: [PHP4BETA] The String "0"
| From: | Andreas Pour | Date: | Thu, 06 Apr 2000 23:14:02 +0000 |
| Subject: | Re: [PHP4BETA] The String "0" | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-13260@lists.php.net to get a copy of this message | ||
Andreas Pour wrote:
>
> Hello,
>
> Wondering why now the string "0" equals false. Used to be you could do
> something like:
>
> while ($entry = readdir($dp))
> {
> ...
> }
>
> but now you have to do:
>
> while (($entry = readdir($dp)) || ($entry == "0"))
Oops, that doesn't work either, you have to do (using Mar. 24
snapshot):
while (($entry = readdir($dp)) || (ord($entry) == 48))
:-(.
Ciao,
Andreas
> {
> ...
> }
>
> which I think is going to cause a lot of people a lot of headaches.
>
> Not that it's particularly hard to deal with once you figure out it's
> required, but it's a strange language construct. Just curious if maybe
> it's a bug.
>
> Ciao,
>
> Andreas
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> For additional commands, e-mail: php4beta-help@lists.php.net
> To contact the list administrators, e-mail: php4beta-admin@lists.php.net