3v4l.org

run code in 300+ 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 8.1.0 - 8.1.7
Define a class... Grab the method... Run it: This method does something.
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 7.4.0 - 7.4.30
Parse error: syntax error, unexpected ')' in /in/gtEi9 on line 13
Process exited with code 255.

preferences:
181.32 ms | 1399 KiB | 64 Q