3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php foreach (get_defined_constants(true) as $category => $constants) { foreach ($constants as $name => $value) { if ('SOL' != substr($name, 0, 3)) continue; echo $name.': '.$value;"\n"; } }
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Output for hhvm-3.10.0 - 3.12.0
Warning: Invalid argument supplied for foreach() in /in/qLWYo on line 8 SOL_UDP: 17SOL_SOCKET: 1SOL_TCP: 6
Output for 5.0.0 - 5.3.29
SOL_SOCKET: 1SOL_TCP: 6SOL_UDP: 17
Output for 4.3.0 - 4.3.10, 4.4.0 - 4.4.9
Warning: Wrong parameter count for get_defined_constants() in /in/qLWYo on line 4 Warning: Invalid argument supplied for foreach() in /in/qLWYo on line 4
Output for 4.3.11
Warning: Wrong parameter count for get_defined_constants() in /in/qLWYo on line 4