3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $decodedData = json_decode(file_get_contents("https://onionoo.torproject.org/bandwidth?search=loki1", true)); $relays = $decodedData['relays']; $firstRelay = reset($relays); $writeHistoryValues = $firstRelay['write_history']['3_days']['values']; var_dump($writeHistoryValues);
Output for 5.4.15 - 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/rNnah on line 3 Warning: file_get_contents(https://onionoo.torproject.org/bandwidth?search=loki1): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/rNnah on line 3 Warning: reset() expects parameter 1 to be array, null given in /in/rNnah on line 7 NULL
Output for hhvm-3.10.0 - 3.12.0
Warning: Failed to open https://onionoo.torproject.org/bandwidth?search=loki1 (Could not resolve host: onionoo.torproject.org) in /in/rNnah on line 3 Warning: Invalid operand type was used: expecting an array in /in/rNnah on line 7 NULL
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/rNnah on line 3 Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/rNnah on line 3 Warning: file_get_contents(https://onionoo.torproject.org/bandwidth?search=loki1): failed to open stream: No such file or directory in /in/rNnah on line 3 Warning: reset() expects parameter 1 to be array, null given in /in/rNnah on line 7 NULL
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/rNnah on line 3 Warning: file_get_contents(https://onionoo.torproject.org/bandwidth?search=loki1): failed to open stream: No such file or directory in /in/rNnah on line 3 Warning: reset(): Passed variable is not an array or object in /in/rNnah on line 7 NULL
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/rNnah on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/rNnah on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/rNnah on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/rNnah on line 3