Re: A php bug or?..
| From: | Daniel P. Brown | Date: | Mon, 08 Aug 2011 20:46:31 +0000 |
| Subject: | Re: A php bug or?.. | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314435@lists.php.net to get a copy of this message | ||
On Mon, Aug 8, 2011 at 16:41, Andre Polykanine <andre@oire.org> wrote:
>
> For sure. But I'm asking: why it doesn't return 0 if it is not an array?
> Logically: no array - no items!
No, actually, if it's a string, it's a single item --- thus, 1.
The documentation should probably reflect that as well. It wasn't
always this way before, though --- in older version of PHP5 it
returned 0, and in all versions of PHP4 it did as well.
Also, keep in mind that a blank string still constitutes a string
and will return 1, but null or nonexistent variables will still return
0.
--
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/