3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = (object)[false]; $foo->{0} = true; $foo = (array)$foo; var_dump($foo); echo json_encode($foo); // {"0":false,"0":true}
based on q89X8
Output for 7.2.0
array(1) { [0]=> bool(true) } [true]
Output for 5.5.0 - 7.1.10
array(2) { [0]=> bool(false) ["0"]=> bool(true) } {"0":false,"0":true}