On Wed, 2007-07-11 at 16:11 -0500, Richard Lynch wrote:
> On Wed, July 11, 2007 9:52 am, Stut wrote:
> >>     $needle = (array)$needle;
> >>
> >> Conversion to array creates an array with one element... the value
> >> converted.
> >
> > Without raising a notice?
> 
> Sure looks like it:
> php -d error_reporting=2047 -r '$foo = (array) "foo"; var_dump($foo);'
> array(1) {
>   [0]=>
>   string(3) "foo"
> }
> 
> But I'd have to say that the intent is not all that clear, really, and
> I'd be leery of this feature, personally.

I wouldn't be leery at all. It's been around for a very long time and
it's documented:


http://www.php.net/manual/en/language.types.array.php#language.types.array.casting

Cheers,
Rob.
-- 
...........................................................
SwarmBuy.com - http://www.swarmbuy.com

    Leveraging the buying power of the masses!
...........................................................

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to