3v4l.org

run code in 300+ PHP versions simultaneously
<?php class XX { var $v = 0; static public function __get($name) { $v++; return $v; } } $x = new XX() define("ASDF", $x->ASDF); print(ASDF); print(ASDF);
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
Warning: The magic method __get() must have public visibility and cannot be static in /in/FtaMA on line 6 Parse error: syntax error, unexpected 'define' (T_STRING) in /in/FtaMA on line 15
Process exited with code 255.

preferences:
146.68 ms | 1395 KiB | 22 Q