3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array( 'key' => 'foo', 'key2' => 'bar', 0 => 'num_foo', 1 => 'num_bar' ); $new_array = array_filter ($arr, function($key) { return is_int($key); }, ARRAY_FILTER_USE_KEY); var_dump($new_array);
Output for 5.6.8 - 7.2.8
array(2) { [0]=> string(7) "num_foo" [1]=> string(7) "num_bar" }
Output for 5.3.20 - 5.5.35
Notice: Use of undefined constant ARRAY_FILTER_USE_KEY - assumed 'ARRAY_FILTER_USE_KEY' in /in/qfar9 on line 10 Warning: array_filter() expects at most 2 parameters, 3 given in /in/qfar9 on line 10 NULL