3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $url = $_GET['url']; header('Content-Type: application/json'); $JSON = file_get_contents($url); // echo the JSON (you can echo this to JavaScript to use it there) echo json_encode($JSON); ?>
Output for 5.3.0 - 7.1.0
Notice: Undefined index: url in /in/vCH8c on line 2 Warning: Cannot modify header information - headers already sent by (output started at /in/vCH8c:2) in /in/vCH8c on line 3 Warning: file_get_contents(): Filename cannot be empty in /in/vCH8c on line 4 false
Output for 5.2.9 - 5.2.17
Notice: Undefined index: url in /in/vCH8c on line 2 Warning: Cannot modify header information - headers already sent by (output started at /in/vCH8c:2) in /in/vCH8c on line 3 Warning: file_get_contents(): Filename cannot be empty in /in/vCH8c on line 4 false
Output for 5.2.3 - 5.2.8
Notice: Undefined index: url in /in/vCH8c on line 2 Warning: Cannot modify header information - headers already sent by (output started at /in/vCH8c:2) in /in/vCH8c on line 3 false
Output for 5.2.0 - 5.2.2
Notice: Undefined index: url in /in/vCH8c on line 2 false
Output for 5.0.0 - 5.1.6
Notice: Undefined index: url in /in/vCH8c on line 2 Fatal error: Call to undefined function json_encode() in /in/vCH8c on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Undefined index: url in /in/vCH8c on line 2 Fatal error: Call to undefined function: json_encode() in /in/vCH8c on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Undefined index: url in /in/vCH8c on line 2 Fatal error: Call to undefined function: json_encode() in /in/vCH8c on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined index: url in /in/vCH8c on line 2 Fatal error: Call to undefined function: json_encode() in /in/vCH8c on line 7