note 90094 added to function.compact
| From: | Anonymous at osu1 dot php dot net | Date: | Mon, 06 Apr 2009 10:41:18 +0000 |
| Subject: | note 90094 added to function.compact | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152854@lists.php.net to get a copy of this message | ||
Compact does not work with references, but there is a short way to resolve this:
//$foo=array();
foreach( array('apple','banana') as $v) $foo[$v] = &$v;
----
Server IP: 92.43.200.200
Probable Submitter: 89.134.66.140
----
Manual Page -- http://www.php.net/manual/en/function.compact.php
Edit -- https://master.php.net/note/edit/90094
Del: integrated -- https://master.php.net/note/delete/90094/integrated
Del: useless -- https://master.php.net/note/delete/90094/useless
Del: bad code -- https://master.php.net/note/delete/90094/bad+code
Del: spam -- https://master.php.net/note/delete/90094/spam
Del: non-english -- https://master.php.net/note/delete/90094/non-english
Del: in docs -- https://master.php.net/note/delete/90094/in+docs
Del: other reasons-- https://master.php.net/note/delete/90094
Reject -- https://master.php.net/note/reject/90094
Search -- https://master.php.net/manage/user-notes.php