Re: Suggestion: echo function(var)[0];
| From: | Jonathan Wage | Date: | Fri, 04 Jun 2010 01:20:23 +0000 |
| Subject: | Re: Suggestion: echo function(var)[0]; | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-48638@lists.php.net to get a copy of this message | ||
Hi,
I've always wondered the same thing too. Would be a nice improvement.
- Jon
On Thu, Jun 3, 2010 at 9:12 PM, Tig <tigger.on@gmail.com> wrote:
> Would be at all possible to implement this kind of shortcut?
>
> echo function(var)[0];
>
> For example, to print the height of an image:
> <?
> echo getimagesize('./path/to/image')[1];
> ?>
>
> Sure, if you want more than one of the returned array points, this
> would not be very efficient, however when you do only need one, it
> would be a lot nicer than:
>
> <?
> $tmp = getimagesize('./path/to/image');
> echo $tmp[1];
> ?>
>
> Anyway, just an idea.
>
> -Tig
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Jonathan H. Wage (+1 415 992 5468)
Open Source Software Developer & Evangelist
sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org
You should follow me on Twitter: http://www.twitter.com/jwage
You can contact Jonathan about Doctrine, Symfony and Open-Source or for
training, consulting, application development, or business related questions
at jonathan.wage@sensio.com