note 114480 deleted from functions.anonymous by cmb
| From: | cmb@php.net | Date: | Sun, 11 Aug 2019 11:29:22 +0000 |
| Subject: | note 114480 deleted from functions.anonymous by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211842@lists.php.net to get a copy of this message | ||
Note Submitter: Victor
----
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.)