3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array ( '/sign/inter?fr=1&fb=1&ht=1&yh=1' => 0, '/sign/meet?fb=1&ht=1&yh=1' => 0, '/sign/blue?fb=1' => 0, '/sign/wall?fb=1' => 0, '/sign/wall?fr=1' => 0, '/sign/inter?fb=1&ht=1&yh=1' => 0, ); var_dump($arr); asort($arr); var_dump($arr); $key = array_shift(array_keys($arr)); var_dump($key);
based on oeZAF
Output for 7.0.0 - 7.1.0
array(6) { ["/sign/inter?fr=1&fb=1&ht=1&yh=1"]=> int(0) ["/sign/meet?fb=1&ht=1&yh=1"]=> int(0) ["/sign/blue?fb=1"]=> int(0) ["/sign/wall?fb=1"]=> int(0) ["/sign/wall?fr=1"]=> int(0) ["/sign/inter?fb=1&ht=1&yh=1"]=> int(0) } array(6) { ["/sign/inter?fr=1&fb=1&ht=1&yh=1"]=> int(0) ["/sign/meet?fb=1&ht=1&yh=1"]=> int(0) ["/sign/blue?fb=1"]=> int(0) ["/sign/wall?fb=1"]=> int(0) ["/sign/wall?fr=1"]=> int(0) ["/sign/inter?fb=1&ht=1&yh=1"]=> int(0) } Notice: Only variables should be passed by reference in /in/tVU79 on line 13 string(31) "/sign/inter?fr=1&fb=1&ht=1&yh=1"
Output for 5.1.0 - 5.6.21
array(6) { ["/sign/inter?fr=1&fb=1&ht=1&yh=1"]=> int(0) ["/sign/meet?fb=1&ht=1&yh=1"]=> int(0) ["/sign/blue?fb=1"]=> int(0) ["/sign/wall?fb=1"]=> int(0) ["/sign/wall?fr=1"]=> int(0) ["/sign/inter?fb=1&ht=1&yh=1"]=> int(0) } array(6) { ["/sign/wall?fr=1"]=> int(0) ["/sign/inter?fb=1&ht=1&yh=1"]=> int(0) ["/sign/wall?fb=1"]=> int(0) ["/sign/blue?fb=1"]=> int(0) ["/sign/meet?fb=1&ht=1&yh=1"]=> int(0) ["/sign/inter?fr=1&fb=1&ht=1&yh=1"]=> int(0) } Strict Standards: Only variables should be passed by reference in /in/tVU79 on line 13 string(15) "/sign/wall?fr=1"
Output for 5.0.5
array(6) { ["/sign/inter?fr=1&fb=1&ht=1&yh=1"]=> int(0) ["/sign/meet?fb=1&ht=1&yh=1"]=> int(0) ["/sign/blue?fb=1"]=> int(0) ["/sign/wall?fb=1"]=> int(0) ["/sign/wall?fr=1"]=> int(0) ["/sign/inter?fb=1&ht=1&yh=1"]=> int(0) } array(6) { ["/sign/wall?fr=1"]=> int(0) ["/sign/inter?fb=1&ht=1&yh=1"]=> int(0) ["/sign/wall?fb=1"]=> int(0) ["/sign/blue?fb=1"]=> int(0) ["/sign/meet?fb=1&ht=1&yh=1"]=> int(0) ["/sign/inter?fr=1&fb=1&ht=1&yh=1"]=> int(0) } Fatal error: Only variables can be passed by reference in /in/tVU79 on line 13
Process exited with code 255.
Output for 4.3.0 - 5.0.4
array(6) { ["/sign/inter?fr=1&fb=1&ht=1&yh=1"]=> int(0) ["/sign/meet?fb=1&ht=1&yh=1"]=> int(0) ["/sign/blue?fb=1"]=> int(0) ["/sign/wall?fb=1"]=> int(0) ["/sign/wall?fr=1"]=> int(0) ["/sign/inter?fb=1&ht=1&yh=1"]=> int(0) } array(6) { ["/sign/wall?fr=1"]=> int(0) ["/sign/inter?fb=1&ht=1&yh=1"]=> int(0) ["/sign/wall?fb=1"]=> int(0) ["/sign/blue?fb=1"]=> int(0) ["/sign/meet?fb=1&ht=1&yh=1"]=> int(0) ["/sign/inter?fr=1&fb=1&ht=1&yh=1"]=> int(0) } string(15) "/sign/wall?fr=1"