3v4l.org

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