3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class X { const A = FOO; const B = BAR; } const FOO=A; echo X::A; new X;
based on 99L6F
Output for 7.2.0 - 7.3.0beta1
Warning: Use of undefined constant A - assumed 'A' (this will throw an Error in a future version of PHP) in /in/QEP6d on line 8 A Warning: Use of undefined constant BAR - assumed 'BAR' (this will throw an Error in a future version of PHP) in /in/QEP6d on line 11
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.20
Notice: Use of undefined constant A - assumed 'A' in /in/QEP6d on line 8 A Notice: Use of undefined constant BAR - assumed 'BAR' in /in/QEP6d on line 11
Output for hhvm-3.15.4
Notice: Use of undefined constant A - assumed 'A' in /in/QEP6d on line 8 A