note 114480 added to functions.anonymous
| From: | Victor | Date: | Tue, 25 Feb 2014 08:26:37 +0000 |
| Subject: | note 114480 added to functions.anonymous | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198705@lists.php.net to get a copy of this message | ||
Please note that while You can assign a closure to an array key with the method
$array['key'] = function() { return $whatever; };
You cannot do the same with the array assignment operator.
So
$array = Array(
'key' => function() { return $whatever; }
);
will NOT work.
(This is indeed awkward.)
----
Server IP: 195.56.44.160
Probable Submitter: 92.52.198.65
----
Manual Page -- http://php.net/manual/en/functions.anonymous.php
Edit -- https://master.php.net/note/edit/114480
Del: integrated -- https://master.php.net/note/delete/114480/integrated
Del: useless -- https://master.php.net/note/delete/114480/useless
Del: bad code -- https://master.php.net/note/delete/114480/bad+code
Del: spam -- https://master.php.net/note/delete/114480/spam
Del: non-english -- https://master.php.net/note/delete/114480/non-english
Del: in docs -- https://master.php.net/note/delete/114480/in+docs
Del: other reasons-- https://master.php.net/note/delete/114480
Reject -- https://master.php.net/note/reject/114480
Search -- https://master.php.net/manage/user-notes.php