3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { private $private_var; public $public_var = 'Foobar'; public function setPrivate($value) { $this->private_var = $value; } public function __debugInfo() { return json_decode(json_encode($this), true); } } $class = new myClass(); $class->setPrivate("Baz"); print_r($class);

preferences:
27.76 ms | 406 KiB | 5 Q