3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 0; var_dump($b::class);
Output for 8.0.14 - 8.0.26, 8.1.0 - 8.1.13
Warning: Undefined variable $b in /in/u2PV1 on line 3 Fatal error: Uncaught TypeError: Cannot use "::class" on value of type null in /in/u2PV1:3 Stack trace: #0 {main} thrown in /in/u2PV1 on line 3
Process exited with code 255.
Output for 8.0.0 - 8.0.13
Warning: Undefined variable $b in /in/u2PV1 on line 2 Fatal error: Uncaught TypeError: Cannot use "::class" on value of type null in /in/u2PV1:3 Stack trace: #0 {main} thrown in /in/u2PV1 on line 3
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Fatal error: Cannot use ::class with dynamic class name in /in/u2PV1 on line 3
Process exited with code 255.
Output for 7.3.0 - 7.3.33
Fatal error: Dynamic class names are not allowed in compile-time ::class fetch in /in/u2PV1 on line 3
Process exited with code 255.

preferences:
53.09 ms | 413 KiB | 5 Q