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); } } $a = new test(); echo $a->jsencode();

preferences:
49.67 ms | 402 KiB | 5 Q