3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php header('Content-Type: text/plain'); $html = file_get_contents('http://www.happyaway.nl/invoice.htm'); $array = [ 'a' => 1, 'b' => 'string', 'c' => $html ]; $json = json_encode($array); echo $json, PHP_EOL; var_dump(json_decode($json));
Output for 5.4.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/f5MgD on line 3 Warning: file_get_contents(http://www.happyaway.nl/invoice.htm): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/f5MgD on line 3 {"a":1,"b":"string","c":false} object(stdClass)#1 (3) { ["a"]=> int(1) ["b"]=> string(6) "string" ["c"]=> bool(false) }
Output for hhvm-3.10.0 - 3.12.0
Warning: Failed to open http://www.happyaway.nl/invoice.htm (Could not resolve host: www.happyaway.nl) in /in/f5MgD on line 3 {"a":1,"b":"string","c":false} object(stdClass)#1 (3) { ["a"]=> int(1) ["b"]=> string(6) "string" ["c"]=> bool(false) }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/f5MgD on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/f5MgD on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/f5MgD on line 6
Process exited with code 255.