3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define("DEFAULT_STOCK_ID", "b"); $stocks = ["a" => 1, "b" => 3, "c" => 4]; $stocks = [$stocks[DEFAULT_STOCK_ID]] + $stocks; unset($stocks[DEFAULT_STOCK_ID]); var_dump($stocks);
Output for 5.6.38 - 7.3.0rc3
array(3) { [0]=> int(3) ["a"]=> int(1) ["c"]=> int(4) }