3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test{ public $test = "toto"; private $esaegaegt = "togaegegto"; public function jsencode(){ return json_encode($this); } public function temp(){ return json_encode(get_object_vars($this)); } } $a = new test(); var_dump($a->temp());

preferences:
41.15 ms | 402 KiB | 5 Q