3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function __debuginfo() { return ['foo' => 'bar']; } public function __sleep() { $this->herp = 'derp'; return ['herp']; } } var_dump(json_encode(new Foo()));
based on i2BGQ
Output for 5.4.0 - 7.2.0
string(2) "{}"