3v4l.org

run code in 300+ PHP versions simultaneously
<?php class String { const THING = __CLASS__ . __LINE__; private function int() {return self::THING;} } $c = (new String)->int();
Output for 7.0.0 - 7.0.2
Fatal error: Cannot use 'String' as class name as it is reserved in /in/WpiHm on line 3
Process exited with code 255.
Output for 5.6.8 - 5.6.17
Fatal error: Call to private method String::int() from context '' in /in/WpiHm on line 8
Process exited with code 255.
Output for 5.5.24 - 5.5.31
Parse error: syntax error, unexpected '.', expecting ',' or ';' in /in/WpiHm on line 4
Process exited with code 255.

preferences:
172.39 ms | 1395 KiB | 28 Q