3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c { protected $b; public function __construct() { $this->b = "hahahaha\n"; } public function __get($b, $args) { return $this->{$b}; } } $c = new c; var_dump($c->b);
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.25
Fatal error: Method c::__get() must take exactly 1 argument in /in/FvF3P on line 15
Process exited with code 255.

preferences:
181.19 ms | 1395 KiB | 62 Q