Re: Why is some_function()[some_index] invalid syntax?
| From: | Nathan Nobbe | Date: | Fri, 11 Jan 2008 05:37:39 +0000 |
| Subject: | Re: Why is some_function()[some_index] invalid syntax? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-267066@lists.php.net to get a copy of this message | ||
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