fork download
  1. <?php
  2.  
  3. $arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4);
  4.  
  5. var_dump(array_filter($arr, function($k) {
  6. return $k == 'b';
  7. }, ARRAY_FILTER_USE_KEY));
Success #stdin #stdout #stderr 0.01s 20568KB
stdin
Standard input is empty
stdout
NULL
stderr
PHP Notice:  Use of undefined constant ARRAY_FILTER_USE_KEY - assumed 'ARRAY_FILTER_USE_KEY' in /home/pIHcPL/prog.php on line 7
PHP Warning:  array_filter() expects at most 2 parameters, 3 given in /home/pIHcPL/prog.php on line 7