note 93791 deleted from function.call-user-func by danbrown
| From: | danbrown@php.net | Date: | Tue, 29 Sep 2009 16:22:06 +0000 |
| Subject: | note 93791 deleted from function.call-user-func by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161151@lists.php.net to get a copy of this message | ||
Note Submitter: ulderico at maber dot com dot br
----
PHP 5.3 is prone to black magic.
Now, you can do this:
$arr = array(1,2);
isset($arr) && is_array($arr) && sizeof($arr) > 0 &&
call_user_func(function() use ($arr) {foreach($arr as $a){print_r($a);}});
It's valid, it'll work.
Should you do it? No.