3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyClass { private $hi = 'Hi'; protected $hello = 'Hello'; public $goodday = 'Goodday'; } $thing = new MyClass(); print json_encode($thing); // {"goodday":"Goodday"} print json_encode((array) $thing); // {"\u0000MyClass\u0000hi":"Hi","\u0000*\u0000hello":"Hello","goodday":"Goodday"}
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0 - 8.5.6
{"goodday":"Goodday"}{"\u0000MyClass\u0000hi":"Hi","\u0000*\u0000hello":"Hello","goodday":"Goodday"}

preferences:
50.74 ms | 854 KiB | 4 Q