3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $bar = 1; function __get() { return "42"; } } $a = new foo(); echo $a->bar; $a->bar = 12;
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.30
Fatal error: Method foo::__get() must take exactly 1 argument in /in/dG98B on line 4
Process exited with code 255.

preferences:
191.12 ms | 1395 KiB | 67 Q