Feature request: anonymous usage of returned values
| From: | Derek Moore | Date: | Sat, 20 Apr 2002 00:26:26 +0000 |
| Subject: | Feature request: anonymous usage of returned values | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-83047@lists.php.net to get a copy of this message | ||
I've been playin' around with Horde and IMP lately... And I've done a lot of
PHP and Perl work in the past... One of the things I really like about PHP is
how it has most of the really cool features of Perl that I enjoy, but lacks
some of the things that annoy me about Perl.
I was making some modifications to IMP's configurations when I tried to use a
feature of Perl that I thought for sure would have been carried over to PHP.
I'm not sure the exact vernacular to describe this feature, but Perl allows
you to anonymously use whatever was returned by a function--e.g., $year =
(localtime($time))[5], so $year takes only the year value of the data returned
by localtime() instead of the entire array.
In IMP I was trying to do:
$conf['spam']['email'] = 'postmaster@' .
(posix_uname())['nodename'];
But instead I have to do:
$uname = posix_uname();
$conf['spam']['email'] = 'postmaster@' . $uname['nodename'];
I realize this is nitpicking a little bit, but being able to handle returned
values in such a manner is quite, quite useful. Or does PHP provide this
functionality through some other syntax?
Anyways, I just thought I'd say somethin' about it. Btw, please reply-to-all,
as I'm not subscribed to this list.
Okay, I'm done now,
Derek
[ derek p. moore ]-------------------[ http://hackunix.org/~derekm/pubkey.asc ]
[ derekm@hackunix.org ]----------------------------[ bfd2 fad6 1014 80c9 aaa8 ]
[ http://hackunix.org/~derekm/ ]-------------------[ a4a0
f449 3461 a443 51b9 ]