Re: strange empty array behavior being at in_array()
| From: | Bogdan Stancescu | Date: | Mon, 24 Dec 2001 14:22:17 +0000 |
| Subject: | Re: strange empty array behavior being at in_array() | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-78654@lists.php.net to get a copy of this message | ||
RTFM: http://www.php.net/manual/en/language.types.type-juggling.php
Peter Vereshagin wrote:
> Bogdan Stancescu wrote:
> >
> > Try in_array('pattern',array('')) and in_array(1,array(0)). The quirk
> > you
> > found is predictable, as we know how PHP behaves when converting strings to
> > integer values...
>
> you mean PHP converts string pattern to integer before apply pattern?
> But what's the kind of technique? ASCII?
>
> > And 'pattern' evaluates to 0 -- '55pattern' for example
> > doesn't match -- but then again, what kinda word is that? :-)
>
> I see no reason not to consider it to evaluate to 0 the same way:)
> Either, you probably mean digits' sense? what kind of?
>
> > Peter Vereshagin wrote:
> >
> > > I think that would not be PHP error. But what's the thing I
> > > misunderstood?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net