Re: Array Question
| From: | Robert Cummings | Date: | Thu, 12 Jul 2007 13:29:38 +0000 |
| Subject: | Re: Array Question | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258689@lists.php.net to get a copy of this message | ||
On Thu, 2007-07-12 at 09:58 +0100, Stut wrote:
> Richard Lynch wrote:
> > On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote:
> >>> 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:
> >>
> >>
> >> TÁ'÷m
> >> ÕúÎØÀ¼¾Œhttp://www.php.net/manual/en/language.types.array.php#language.types.array.casting
> >
> > As soon as I hit send I knew that would be mis-interpreted...
> >
> > Leery is the wrong word.
> >
> > Sorry.
> >
> > It just seems a bit to clever to me...
> >
> > I suspect I'd skim this code a hundred times and not realize what it
> > was doing.
> >
> > But maybe that's just me. :-)
>
> I would have to agree. I'm a big fan of self-documenting code, and this
> one requires a little bit more knowledge of the intricacies of PHP than
> I would expect from your 'average' developer.
Hmmm, I thought using an explicit cast was very self explanatory --
especially when the name of the cast is "array". Maybe I'm alone in that
thought. I mean if you convert a scalar to an array what do you expect
to get? An array with the scalar. *shrug* I can't see how it would be
anything else.
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................