3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); # works $json = file_get_contents('https://creativecommons.tankerkoenig.de/json/detail.php?id=fb79c457-543a-4ff6-ba70-cd270ac2110a&apikey=00000000-0000-0000-0000-000000000001&_=1440230150968'); $x = json_decode($json); $preis_e5 = $x->station->e5; $preis_diesel = $x->station->diesel; echo $preis_e5; echo $preis_diesel; echo "<pre>"; print_r( $x ); ?>
based on ZVmMh
Output for 7.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/cb6so on line 4 Warning: file_get_contents(https://creativecommons.tankerkoenig.de/json/detail.php?id=fb79c457-543a-4ff6-ba70-cd270ac2110a&apikey=00000000-0000-0000-0000-000000000001&_=1440230150968): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/cb6so on line 4 Notice: Trying to get property 'station' of non-object in /in/cb6so on line 6 Notice: Trying to get property 'e5' of non-object in /in/cb6so on line 6 Notice: Trying to get property 'station' of non-object in /in/cb6so on line 7 Notice: Trying to get property 'diesel' of non-object in /in/cb6so on line 7 <pre>
Output for 7.0.20, 7.1.5 - 7.1.10
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/cb6so on line 4 Warning: file_get_contents(https://creativecommons.tankerkoenig.de/json/detail.php?id=fb79c457-543a-4ff6-ba70-cd270ac2110a&apikey=00000000-0000-0000-0000-000000000001&_=1440230150968): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/cb6so on line 4 Notice: Trying to get property of non-object in /in/cb6so on line 6 Notice: Trying to get property of non-object in /in/cb6so on line 6 Notice: Trying to get property of non-object in /in/cb6so on line 7 Notice: Trying to get property of non-object in /in/cb6so on line 7 <pre>
Output for 5.4.15 - 7.0.11, 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/cb6so on line 4 Warning: file_get_contents(https://creativecommons.tankerkoenig.de/json/detail.php?id=fb79c457-543a-4ff6-ba70-cd270ac2110a&apikey=00000000-0000-0000-0000-000000000001&_=1440230150968): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/cb6so on line 4 Notice: Trying to get property of non-object in /in/cb6so on line 6 Notice: Trying to get property of non-object in /in/cb6so on line 6 Notice: Trying to get property of non-object in /in/cb6so on line 7 Notice: Trying to get property of non-object in /in/cb6so on line 7 <pre>
Output for 5.3.0 - 5.4.14
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/cb6so on line 4 Warning: file_get_contents(https://creativecommons.tankerkoenig.de/json/detail.php?id=fb79c457-543a-4ff6-ba70-cd270ac2110a&apikey=00000000-0000-0000-0000-000000000001&_=1440230150968): failed to open stream: No such file or directory in /in/cb6so on line 4 Notice: Trying to get property of non-object in /in/cb6so on line 6 Notice: Trying to get property of non-object in /in/cb6so on line 6 Notice: Trying to get property of non-object in /in/cb6so on line 7 Notice: Trying to get property of non-object in /in/cb6so on line 7 <pre>
Output for 5.2.0 - 5.2.17
Notice: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/cb6so on line 4 Warning: file_get_contents(https://creativecommons.tankerkoenig.de/json/detail.php?id=fb79c457-543a-4ff6-ba70-cd270ac2110a&apikey=00000000-0000-0000-0000-000000000001&_=1440230150968): failed to open stream: No such file or directory in /in/cb6so on line 4 Notice: Trying to get property of non-object in /in/cb6so on line 6 Notice: Trying to get property of non-object in /in/cb6so on line 6 Notice: Trying to get property of non-object in /in/cb6so on line 7 Notice: Trying to get property of non-object in /in/cb6so on line 7 <pre>
Output for 5.0.0 - 5.1.6
Notice: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/cb6so on line 4 Warning: file_get_contents(https://creativecommons.tankerkoenig.de/json/detail.php?id=fb79c457-543a-4ff6-ba70-cd270ac2110a&apikey=00000000-0000-0000-0000-000000000001&_=1440230150968): failed to open stream: No such file or directory in /in/cb6so on line 4 Fatal error: Call to undefined function json_decode() in /in/cb6so on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/cb6so on line 4 Warning: file_get_contents(https://creativecommons.tankerkoenig.de/json/detail.php?id=fb79c457-543a-4ff6-ba70-cd270ac2110a&apikey=00000000-0000-0000-0000-000000000001&_=1440230150968): failed to open stream: No such file or directory in /in/cb6so on line 4 Fatal error: Call to undefined function: json_decode() in /in/cb6so on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/cb6so on line 4 Warning: file_get_contents(https://creativecommons.tankerkoenig.de/json/detail.php?id=fb79c457-543a-4ff6-ba70-cd270ac2110a&apikey=00000000-0000-0000-0000-000000000001&_=1440230150968): failed to open stream: No such file or directory in /in/cb6so on line 4 Fatal error: Call to undefined function: json_decode() in /in/cb6so on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: file_get_contents() [http://www.php.net/function.file-get-contents]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/cb6so on line 4 Warning: file_get_contents(https://creativecommons.tankerkoenig.de/json/detail.php?id=fb79c457-543a-4ff6-ba70-cd270ac2110a&apikey=00000000-0000-0000-0000-000000000001&_=1440230150968) [http://www.php.net/function.file-get-contents]: failed to create stream: No such file or directory in /in/cb6so on line 4 Fatal error: Call to undefined function: json_decode() in /in/cb6so on line 5