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.3.0, 8.3.2, 8.3.4, 8.3.7, 8.3.9
313a
Output for 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.1, 8.3.3, 8.3.5 - 8.3.6, 8.3.8
262a
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:
180.78 ms | 402 KiB | 249 Q