3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getBTCValue() { $url = 'http://middlecoin.com'; $contents = file_get_contents($url); preg_match_all('/<td>(.*?)<\/td>/s', $contents, $matches); $ex = explode(" ", strip_tags($matches[0][0])); $output .= "<span style='color:red; font-weight:bold;'>Balance:</span> ".$matches[0][5]."<br>"; $output .= "<span style='color:#3399ff; font-weight:bold;'>Unexchanged:</span> ".$matches[0][4]."<br>"; $output = "<span style='color:#51d051; font-weight:bold;'>Immature:</span> ".$matches[0][3]."<br>"; $output .= "<span style='color:#000000; font-weight:bold;'>Paid:</span> ".$matches[0][6]."<br>"; return $output; } var_dump(getBTCValue());
Output for 5.3.0 - 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/6BWBu on line 5 Warning: file_get_contents(http://middlecoin.com): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/6BWBu on line 5 Notice: Undefined offset: 0 in /in/6BWBu on line 7 Notice: Undefined offset: 5 in /in/6BWBu on line 9 Notice: Undefined variable: output in /in/6BWBu on line 9 Notice: Undefined offset: 4 in /in/6BWBu on line 10 Notice: Undefined offset: 3 in /in/6BWBu on line 11 Notice: Undefined offset: 6 in /in/6BWBu on line 12 string(132) "<span style='color:#51d051; font-weight:bold;'>Immature:</span> <br><span style='color:#000000; font-weight:bold;'>Paid:</span> <br>"
Output for 5.2.6 - 5.2.17
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/6BWBu on line 5 Warning: file_get_contents(http://middlecoin.com): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/6BWBu on line 5 Notice: Undefined offset: 0 in /in/6BWBu on line 7 Notice: Undefined offset: 5 in /in/6BWBu on line 9 Notice: Undefined variable: output in /in/6BWBu on line 9 Notice: Undefined offset: 4 in /in/6BWBu on line 10 Notice: Undefined offset: 3 in /in/6BWBu on line 11 Notice: Undefined offset: 6 in /in/6BWBu on line 12 string(132) "<span style='color:#51d051; font-weight:bold;'>Immature:</span> <br><span style='color:#000000; font-weight:bold;'>Paid:</span> <br>"
Output for 5.0.4 - 5.2.5
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/6BWBu on line 5 Warning: file_get_contents(http://middlecoin.com): failed to open stream: Connection refused in /in/6BWBu on line 5 Notice: Undefined offset: 0 in /in/6BWBu on line 7 Notice: Undefined offset: 5 in /in/6BWBu on line 9 Notice: Undefined variable: output in /in/6BWBu on line 9 Notice: Undefined offset: 4 in /in/6BWBu on line 10 Notice: Undefined offset: 3 in /in/6BWBu on line 11 Notice: Undefined offset: 6 in /in/6BWBu on line 12 string(132) "<span style='color:#51d051; font-weight:bold;'>Immature:</span> <br><span style='color:#000000; font-weight:bold;'>Paid:</span> <br>"
Output for 4.3.3 - 4.3.4, 4.3.10 - 4.4.9, 5.0.3
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/6BWBu on line 5 Warning: file_get_contents(http://middlecoin.com): failed to open stream: Connection refused in /in/6BWBu on line 5 Notice: Undefined offset: 0 in /in/6BWBu on line 7 Notice: Undefined offset: 5 in /in/6BWBu on line 9 Notice: Undefined variable: output in /in/6BWBu on line 9 Notice: Undefined offset: 4 in /in/6BWBu on line 10 Notice: Undefined offset: 3 in /in/6BWBu on line 11 Notice: Undefined offset: 6 in /in/6BWBu on line 12 string(132) "<span style='color:#51d051; font-weight:bold;'>Immature:</span> <br><span style='color:#000000; font-weight:bold;'>Paid:</span> <br>"
Output for 4.3.5 - 4.3.9, 5.0.1 - 5.0.2
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/6BWBu on line 5 Warning: file_get_contents(http://middlecoin.com): failed to open stream: Success in /in/6BWBu on line 5 Notice: Undefined offset: 0 in /in/6BWBu on line 7 Notice: Undefined offset: 5 in /in/6BWBu on line 9 Notice: Undefined variable: output in /in/6BWBu on line 9 Notice: Undefined offset: 4 in /in/6BWBu on line 10 Notice: Undefined offset: 3 in /in/6BWBu on line 11 Notice: Undefined offset: 6 in /in/6BWBu on line 12 string(132) "<span style='color:#51d051; font-weight:bold;'>Immature:</span> <br><span style='color:#000000; font-weight:bold;'>Paid:</span> <br>"
Output for 5.0.0
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/6BWBu on line 5 Warning: file_get_contents(http://middlecoin.com): failed to open stream: Bad file descriptor in /in/6BWBu on line 5 Notice: Undefined offset: 0 in /in/6BWBu on line 7 Notice: Undefined offset: 5 in /in/6BWBu on line 9 Notice: Undefined variable: output in /in/6BWBu on line 9 Notice: Undefined offset: 4 in /in/6BWBu on line 10 Notice: Undefined offset: 3 in /in/6BWBu on line 11 Notice: Undefined offset: 6 in /in/6BWBu on line 12 string(132) "<span style='color:#51d051; font-weight:bold;'>Immature:</span> <br><span style='color:#000000; font-weight:bold;'>Paid:</span> <br>"
Output for 4.3.2
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /in/6BWBu on line 5 Warning: file_get_contents(http://middlecoin.com): failed to open stream: Connection refused in /in/6BWBu on line 5 Notice: Undefined offset: 0 in /in/6BWBu on line 7 Notice: Undefined offset: 5 in /in/6BWBu on line 9 Notice: Undefined variable: output in /in/6BWBu on line 9 Notice: Undefined offset: 4 in /in/6BWBu on line 10 Notice: Undefined offset: 3 in /in/6BWBu on line 11 Notice: Undefined offset: 6 in /in/6BWBu on line 12 string(132) "<span style='color:#51d051; font-weight:bold;'>Immature:</span> <br><span style='color:#000000; font-weight:bold;'>Paid:</span> <br>"
Output for 4.3.0 - 4.3.1
Warning: file_get_contents() [http://www.php.net/function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/6BWBu on line 5 Warning: file_get_contents(http://middlecoin.com) [http://www.php.net/function.file-get-contents]: failed to create stream: Connection refused in /in/6BWBu on line 5 Notice: Undefined offset: 0 in /in/6BWBu on line 7 Notice: Undefined offset: 5 in /in/6BWBu on line 9 Notice: Undefined variable: output in /in/6BWBu on line 9 Notice: Undefined offset: 4 in /in/6BWBu on line 10 Notice: Undefined offset: 3 in /in/6BWBu on line 11 Notice: Undefined offset: 6 in /in/6BWBu on line 12 string(132) "<span style='color:#51d051; font-weight:bold;'>Immature:</span> <br><span style='color:#000000; font-weight:bold;'>Paid:</span> <br>"