3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $wyniki = []; $wyniki["w1"] = 100; $wyniki["w2"] = 300; $wyniki["w3"] = 50; $wyniki["w4"] = 800; print_r($wyniki); arsort($wyniki); echo PHP_EOL; print_r( $wyniki ); echo PHP_EOL; echo sprintf("klucz %s", key($wyniki));
based on TTsqM
Output for 5.4.8 - 7.3.0rc4
Array ( [w1] => 100 [w2] => 300 [w3] => 50 [w4] => 800 ) Array ( [w4] => 800 [w2] => 300 [w1] => 100 [w3] => 50 ) klucz w4
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Ce3o6 on line 2
Process exited with code 255.