3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( 'filters'=> array('where'=>array('yr'=>1994))); $keys = array_keys($array['filters']['where']); echo array_shift(eval(var_dump(array_keys($array['filters']['where']))));
based on tLLeK
Output for 7.0.0 - 7.1.0
array(1) { [0]=> string(2) "yr" } Notice: Only variables should be passed by reference in /in/uRkAk on line 4 Warning: array_shift() expects parameter 1 to be array, boolean given in /in/uRkAk on line 4
Output for hhvm-3.10.0 - 3.12.0
array(1) { [0]=> string(2) "yr" } Strict Warning: Only variables should be passed by reference in /in/uRkAk on line 4 Warning: array_shift() expects parameter 1 to be an array or mutable collection in /in/uRkAk on line 4
Output for 5.3.0 - 5.6.28
array(1) { [0]=> string(2) "yr" } Warning: array_shift() expects parameter 1 to be array, boolean given in /in/uRkAk on line 4
Output for 4.3.2 - 5.2.17
array(1) { [0]=> string(2) "yr" } Warning: array_shift(): The argument should be an array in /in/uRkAk on line 4
Output for 4.3.0 - 4.3.1
array(1) { [0]=> string(2) "yr" } Warning: array_shift() [http://www.php.net/function.array-shift]: The argument should be an array in /in/uRkAk on line 4