3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function foo() { return 'foo'; } } $classname = 'A'; get_class($classname)::foo();
Output for 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
Fatal error: Uncaught TypeError: get_class(): Argument #1 ($object) must be of type object, string given in /in/5dMEc:11 Stack trace: #0 {main} thrown in /in/5dMEc on line 11
Process exited with code 255.

preferences:
40.2 ms | 406 KiB | 5 Q