3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo foo::TWO; const ONE = 1; class foo { const TWO = ONE * 2; } ?>
Output for 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
Fatal error: Uncaught Error: Undefined constant "ONE" in /in/eQRZn:9 Stack trace: #0 /in/eQRZn(3): [constant expression]() #1 {main} thrown in /in/eQRZn on line 9
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27
Fatal error: Uncaught Error: Undefined constant "ONE" in /in/eQRZn:3 Stack trace: #0 {main} thrown in /in/eQRZn on line 3
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: Use of undefined constant ONE - assumed 'ONE' (this will throw an Error in a future version of PHP) in /in/eQRZn on line 3 Warning: A non-numeric value encountered in /in/eQRZn on line 3 0
Output for 7.1.0 - 7.1.25
Notice: Use of undefined constant ONE - assumed 'ONE' in /in/eQRZn on line 3 Warning: A non-numeric value encountered in /in/eQRZn on line 3 0
Output for 5.6.0 - 5.6.23, 7.0.0 - 7.0.20
Notice: Use of undefined constant ONE - assumed 'ONE' in /in/eQRZn on line 3 0

preferences:
71.84 ms | 411 KiB | 5 Q