3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private static $var = 1; public function __get($name) { return $this->$name; } public function __set($name, $value) { $this->$name = $value; } } $f = new Foo; echo $f->var; $f->var = 2; echo $f->var; var_dump($f);

preferences:
39.71 ms | 402 KiB | 5 Q