3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $x = 42; function __get($name) { $test = new Test2($this); return $test->$name;} } class Test2 { function __construct($arg) { $this->arg = $arg; } function __get($name) { return $this->arg->$name; } } error_reporting(E_ALL|E_NOTICE| E_STRICT); $test = new Test; var_dump($test->x);

preferences:
36.2 ms | 402 KiB | 5 Q