3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); ini_set('display_errors','1'); function declare_assoc(&$myArray, $value) { $err = error_reporting(); error_reporting(0); $myArray = $value; error_reporting($err); } echo "no errors:\n"; declare_assoc($productitems['a']['b']['c']['d']['e']['f'], 65); var_dump($productitems); echo "errors: \n"; $blah['a']['b']['c']['d']['e']['f'] = 65; var_dump($blah);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
no errors: array(1) { ["a"]=> array(1) { ["b"]=> array(1) { ["c"]=> array(1) { ["d"]=> array(1) { ["e"]=> array(1) { ["f"]=> int(65) } } } } } } errors: array(1) { ["a"]=> array(1) { ["b"]=> array(1) { ["c"]=> array(1) { ["d"]=> array(1) { ["e"]=> array(1) { ["f"]=> int(65) } } } } } }