3v4l.org

run code in 500+ PHP versions simultaneously
<?php echo "Define a class...\n"; class ThisIsAContainer { public static function thisIsAMethod(){ echo "This method does something."; } } echo "Grab the method...\n"; $function = ThisIsAContainer::thisIsAMethod(...); echo "Run it:\n"; $function();
Output for 7.4.0 - 7.4.30
Parse error: syntax error, unexpected ')' in /in/gtEi9 on line 13
Process exited with code 255.
Output for 8.0.1 - 8.0.20
Parse error: syntax error, unexpected token ")" in /in/gtEi9 on line 13
Process exited with code 255.
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.34, 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
Define a class... Grab the method... Run it: This method does something.

preferences:
35.69 ms | 1159 KiB | 11 Q