3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $test = array(); $test['parent'] = array(); $test['parent']['child'] = 'foo'; $test['parent'][false] = 'bar'; $test['parent'][null] = 'baz'; var_dump($test); var_dump($test['parent'][(string) null]); var_dump($test['parent'][(string) false]);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(1) { ["parent"]=> array(3) { ["child"]=> string(3) "foo" [0]=> string(3) "bar" [""]=> string(3) "baz" } } string(3) "baz" string(3) "baz"