View Single Post

  #6 (permalink)  
Old 01-11-2008
Nathan Nobbe
 
Posts: n/a
Default Re: [PHP] Why is some_function()[some_index] invalid syntax?

On Jan 11, 2008 12:25 AM, Jim Lucas <lists@cmsws.com> wrote:

> So, make all your functions return objects, and have the object have a
> method called get or index or something like that that returns the index
> requested. :)
>
> Better yet, make everything an object: String, Numeric, Array, etc
>


i like using stdClass as a container sometimes, however it doesnt have
the plethora of utility functions that arrays do :(
there are workarounds of course, but obviously i just store the result to
a variable and subsequently use that.
this is just one of those little things picky, non-commiters like myself
bitch about :)

-nathan

Reply With Quote