3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (strnatcmp(phpversion(),'5.4.7') >= 0) { $host="127.0.0.1" ; $port=9878; $timeout=30; $sk=fsockopen($host,$port,$errnum,$errstr,$timeout) ; if (!is_resource($sk)) { exit("connection fail: ".$errnum." ".$errstr) ; } else { echo "Connected"; } } ?>
Output for 5.4.7 - 5.6.38, 7.0.0 - 7.2.11
Warning: fsockopen(): unable to connect to 127.0.0.1:9878 (Connection refused) in /in/8lqg5 on line 7 connection fail: 111 Connection refused
Output for hhvm-3.22.0
Warning: failed to connect to 127.0.0.1 [111]: Connection refused in /in/8lqg5 on line -1 connection fail: 111 Connection refused
Output for hhvm-3.10.1 - 3.21.3
Warning: failed to connect to 127.0.0.1 [111]: Connection refused in /in/8lqg5 on line 7 connection fail: 111 Connection refused
Output for 4.3.0 - 5.4.6