note 106187 deleted from function.array-filter by danbrown
| From: | danbrown@php.net | Date: | Tue, 18 Oct 2011 14:48:15 +0000 |
| Subject: | note 106187 deleted from function.array-filter by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-183974@lists.php.net to get a copy of this message | ||
Note Submitter: nino at recgr dot com
Reason: 5
----
Beware.
<?php
$array = array('one', 'two', 'three');
function test($what) {
if ($what === $what) {
// lol
return true;
}
}
// this will not work
array_filter($array, 'test');
// this will
$array = array_filter($array, 'test');
?>
It must be called inside a variable. Strange behavior, if you ask me.