3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $host="127.0.0.1" ; $port=9875; $timeout=30; $sk=fsockopen($host,$port,$errnum,$errstr,$timeout) ; if (!is_resource($sk)) { exit("connection fail: ".$errnum." ".$errstr) ; } else { echo "Connected"; } ?>
Output for 5.0.0 - 7.1.0
Warning: fsockopen(): unable to connect to 127.0.0.1:9875 (Connection refused) in /in/USuVb on line 5 connection fail: 111 Connection refused
Output for 4.3.3 - 4.4.9
Warning: fsockopen(): unable to connect to 127.0.0.1:9875 in /in/USuVb on line 5 connection fail: 111 Connection refused
Output for 4.3.2
Warning: fsockopen(): php_hostconnect: connect failed in /in/USuVb on line 5 Warning: fsockopen(): unable to connect to 127.0.0.1:9875 in /in/USuVb on line 5 connection fail: 111 Connection refused
Output for 4.3.0 - 4.3.1

Process exited with code 139.