3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeConstants { const RECURSIVE_CONSTANT = self::RECURSIVE_CONSTANT; } var_dump(SomeConstants::RECURSIVE_CONSTANT);
Output for 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Fatal error: Uncaught Error: Cannot declare self-referencing constant self::RECURSIVE_CONSTANT in /in/caUW0:5 Stack trace: #0 /in/caUW0(7): [constant expression]() #1 {main} thrown in /in/caUW0 on line 5
Process exited with code 255.
Output for 8.2.0 - 8.2.29
Fatal error: Uncaught Error: Cannot declare self-referencing constant self::RECURSIVE_CONSTANT in /in/caUW0:5 Stack trace: #0 {main} thrown in /in/caUW0 on line 5
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33
Fatal error: Uncaught Error: Cannot declare self-referencing constant self::RECURSIVE_CONSTANT in /in/caUW0:7 Stack trace: #0 {main} thrown in /in/caUW0 on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Cannot declare self-referencing constant 'self::RECURSIVE_CONSTANT' in /in/caUW0:7 Stack trace: #0 {main} thrown in /in/caUW0 on line 7
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Fatal error: Cannot declare self-referencing constant 'self::RECURSIVE_CONSTANT' in /in/caUW0 on line 7
Process exited with code 255.

preferences:
150.87 ms | 411 KiB | 5 Q