3v4l.org

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