3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $link = "http://boards.4chan.org/vg/catalog"; $linkcontents = file_get_contents($link); $lines = explode("\n", $linkcontents); $jsstart = explode("var catalog = ", $lines[10]); $jssend = explode(" var", $jsstart[1]); $json = $jssend[0]; var_dump($linkcontents); var_dump($lines); echo $jsstart[1]; echo $json;
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/u17Bc on line 3 Warning: file_get_contents(http://boards.4chan.org/vg/catalog): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/u17Bc on line 3 Notice: Undefined offset: 10 in /in/u17Bc on line 5 Notice: Undefined offset: 1 in /in/u17Bc on line 6 bool(false) array(1) { [0]=> string(0) "" } Notice: Undefined offset: 1 in /in/u17Bc on line 10
Output for hhvm-3.12.0 - 3.13.2
Warning: Failed to open http://boards.4chan.org/vg/catalog (Could not resolve host: boards.4chan.org) in /in/u17Bc on line 3 Notice: Undefined index: 10 in /in/u17Bc on line 5 Warning: explode() expects parameter 2 to be string, null given in /in/u17Bc on line 5 Warning: explode() expects parameter 2 to be string, null given in /in/u17Bc on line 6 bool(false) array(1) { [0]=> string(0) "" }
Output for hhvm-3.10.0
Warning: Failed to open http://boards.4chan.org/vg/catalog (Could not resolve host: boards.4chan.org) in /in/u17Bc on line 3 Notice: Undefined index: 10 in /in/u17Bc on line 5 Notice: Undefined index: 1 in /in/u17Bc on line 6 bool(false) array(1) { [0]=> string(0) "" } Notice: Undefined index: 1 in /in/u17Bc on line 10
Output for 5.2.6 - 5.2.17
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/u17Bc on line 3 Warning: file_get_contents(http://boards.4chan.org/vg/catalog): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/u17Bc on line 3 Notice: Undefined offset: 10 in /in/u17Bc on line 5 Notice: Undefined offset: 1 in /in/u17Bc on line 6 bool(false) array(1) { [0]=> string(0) "" } Notice: Undefined offset: 1 in /in/u17Bc on line 10
Output for 4.3.3 - 4.3.4, 4.3.10 - 4.4.9, 5.0.3 - 5.2.5
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/u17Bc on line 3 Warning: file_get_contents(http://boards.4chan.org/vg/catalog): failed to open stream: Connection refused in /in/u17Bc on line 3 Notice: Undefined offset: 10 in /in/u17Bc on line 5 Notice: Undefined offset: 1 in /in/u17Bc on line 6 bool(false) array(1) { [0]=> string(0) "" } Notice: Undefined offset: 1 in /in/u17Bc on line 10
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/u17Bc on line 3 Warning: file_get_contents(http://boards.4chan.org/vg/catalog): failed to open stream: Success in /in/u17Bc on line 3 Notice: Undefined offset: 10 in /in/u17Bc on line 5 Notice: Undefined offset: 1 in /in/u17Bc on line 6 bool(false) array(1) { [0]=> string(0) "" } Notice: Undefined offset: 1 in /in/u17Bc on line 10
Output for 5.0.0
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/u17Bc on line 3 Warning: file_get_contents(http://boards.4chan.org/vg/catalog): failed to open stream: Bad file descriptor in /in/u17Bc on line 3 Notice: Undefined offset: 10 in /in/u17Bc on line 5 Notice: Undefined offset: 1 in /in/u17Bc on line 6 bool(false) array(1) { [0]=> string(0) "" } Notice: Undefined offset: 1 in /in/u17Bc on line 10
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/u17Bc on line 3 Warning: file_get_contents(http://boards.4chan.org/vg/catalog): failed to open stream: Connection refused in /in/u17Bc on line 3 Notice: Undefined offset: 10 in /in/u17Bc on line 5 Notice: Undefined offset: 1 in /in/u17Bc on line 6 bool(false) array(1) { [0]=> string(0) "" } Notice: Undefined offset: 1 in /in/u17Bc on line 10
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/u17Bc on line 3 Warning: file_get_contents(http://boards.4chan.org/vg/catalog) [http://www.php.net/function.file-get-contents]: failed to create stream: Connection refused in /in/u17Bc on line 3 Notice: Undefined offset: 10 in /in/u17Bc on line 5 Notice: Undefined offset: 1 in /in/u17Bc on line 6 bool(false) array(1) { [0]=> string(0) "" } Notice: Undefined offset: 1 in /in/u17Bc on line 10