Suggestion: echo function(var)[0];
| From: | Tig | Date: | Fri, 04 Jun 2010 01:12:13 +0000 |
| Subject: | Suggestion: echo function(var)[0]; | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-48635@lists.php.net to get a copy of this message | ||
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