3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace BAR { print foo::T_STRING; } namespace BAR { const T_STRING = 'a'; echo T_STRING; class foo { const T_STRING = T_STRING; } }
Output for 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.1, 8.3.3, 8.3.5 - 8.3.6, 8.3.8, 8.3.10, 8.3.12, 8.3.14, 8.4.1 - 8.4.2
262a
Output for 8.3.0, 8.3.2, 8.3.4, 8.3.7, 8.3.9, 8.3.11, 8.3.13, 8.3.15
313a
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.29
311a
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
319a
Output for 5.6.0 - 5.6.30
310a

preferences:
69.73 ms | 410 KiB | 5 Q