note 35792 added to function.current
| From: | si at rn2 dot php dot net | Date: | Mon, 15 Sep 2003 02:57:43 +0000 |
| Subject: | note 35792 added to function.current | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-56495@lists.php.net to get a copy of this message | ||
current isn't able to return by reference, eg.
function &getDataPacket()
{
global $globalref;
return current( $globalref[ key( $globalref ) ]->dp ); // *FAILS*
return $globalref[ key( $globalref ) ]->dp[ key( $globalref[ key( $globalref ) ]->dp ) ]; //
*WORKS*
}
According to Bug#12692 it's intentional, so watch out!
----
Manual Page -- http://www.php.net/manual/en/function.current.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35792
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35792&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35792&report=yes