3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-Type: text/html; charset=UTF-8'); function traffic($startlat, $startlon, $endlat, $endlon) { GLOBAL $traffic; $traffic=file_get_contents('https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A'.$startlon.'+y%3A'.$startlat.'&to=x%3A'.$endlon.'+y%3A'.$endlat.'&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0'); $traffic=json_decode($traffic,true); $tijd=0;$lengte=0; foreach($traffic['response']['results'] as $street) { $tijd = $tijd + $street['crossTime']; $lengte = $lengte + $street['length']; } $tijd = strftime("%M:%S",$tijd); $lengte = round($lengte / 1000,0); return array('tijd' => $tijd, 'lengte' => $lengte); } // $hw = traffic(50.892565,3.114135,50.877122,4.164326); // echo 'Home - Work = '.$hw['tijd'].' / '.$hw['lengte'].'km<br>'; // $wh = traffic(50.877122,4.164326,50.892565,3.114135); // echo 'Work - Home = '.$wh['tijd'].' / '.$wh['lengte'].'km<br>'; $hw = traffic(32.223122,34.993726,32.061679,34.793838); echo 'kokav - Work = '.$hw['tijd'].' / '.$hw['lengte'].'km<br>'; $hw = traffic(32.293122,34.993726,32.061679,34.793838); echo 'kokav2 - Work time MM:SS= '.$hw['tijd'].' / '.$hw['lengte'].'km<br>';
Output for 8.3.0 - 8.3.6
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): Failed to open stream: Operation not permitted in /in/4sK5o on line 6 Warning: Trying to access array offset on null in /in/4sK5o on line 10 Warning: Trying to access array offset on null in /in/4sK5o on line 10 Warning: foreach() argument must be of type array|object, null given in /in/4sK5o on line 10 Deprecated: Function strftime() is deprecated in /in/4sK5o on line 14 kokav - Work = 00:00 / 0km<br> Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): Failed to open stream: Operation not permitted in /in/4sK5o on line 6 Warning: Trying to access array offset on null in /in/4sK5o on line 10 Warning: Trying to access array offset on null in /in/4sK5o on line 10 Warning: foreach() argument must be of type array|object, null given in /in/4sK5o on line 10 Deprecated: Function strftime() is deprecated in /in/4sK5o on line 14 kokav2 - Work time MM:SS= 00:00 / 0km<br>
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): Failed to open stream: Operation not permitted in /in/4sK5o on line 6 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: foreach() argument must be of type array|object, null given in /in/4sK5o on line 10 Deprecated: Function strftime() is deprecated in /in/4sK5o on line 14 kokav - Work = 00:00 / 0km<br> Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): Failed to open stream: Operation not permitted in /in/4sK5o on line 6 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: foreach() argument must be of type array|object, null given in /in/4sK5o on line 10 Deprecated: Function strftime() is deprecated in /in/4sK5o on line 14 kokav2 - Work time MM:SS= 00:00 / 0km<br>
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): Failed to open stream: Operation not permitted in /in/4sK5o on line 6 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: foreach() argument must be of type array|object, null given in /in/4sK5o on line 10 kokav - Work = 00:00 / 0km<br> Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): Failed to open stream: Operation not permitted in /in/4sK5o on line 6 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: foreach() argument must be of type array|object, null given in /in/4sK5o on line 10 kokav2 - Work time MM:SS= 00:00 / 0km<br>
Output for 8.0.13
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): Failed to open stream: No such file or directory in /in/4sK5o on line 6 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: foreach() argument must be of type array|object, null given in /in/4sK5o on line 10 kokav - Work = 00:00 / 0km<br> Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): Failed to open stream: No such file or directory in /in/4sK5o on line 6 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: foreach() argument must be of type array|object, null given in /in/4sK5o on line 10 kokav2 - Work time MM:SS= 00:00 / 0km<br>
Output for 7.4.33
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): failed to open stream: No such file or directory in /in/4sK5o on line 6 Notice: Trying to access array offset on value of type null in /in/4sK5o on line 10 Notice: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: Invalid argument supplied for foreach() in /in/4sK5o on line 10 kokav - Work = 00:00 / 0km<br> Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): failed to open stream: No such file or directory in /in/4sK5o on line 6 Notice: Trying to access array offset on value of type null in /in/4sK5o on line 10 Notice: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: Invalid argument supplied for foreach() in /in/4sK5o on line 10 kokav2 - Work time MM:SS= 00:00 / 0km<br>
Output for 7.4.0 - 7.4.32
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): failed to open stream: Operation not permitted in /in/4sK5o on line 6 Notice: Trying to access array offset on value of type null in /in/4sK5o on line 10 Notice: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: Invalid argument supplied for foreach() in /in/4sK5o on line 10 kokav - Work = 00:00 / 0km<br> Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): failed to open stream: Operation not permitted in /in/4sK5o on line 6 Notice: Trying to access array offset on value of type null in /in/4sK5o on line 10 Notice: Trying to access array offset on value of type null in /in/4sK5o on line 10 Warning: Invalid argument supplied for foreach() in /in/4sK5o on line 10 kokav2 - Work time MM:SS= 00:00 / 0km<br>
Output for 5.4.0 - 5.4.45, 7.3.32 - 7.3.33
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): failed to open stream: No such file or directory in /in/4sK5o on line 6 Warning: Invalid argument supplied for foreach() in /in/4sK5o on line 10 kokav - Work = 00:00 / 0km<br> Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): failed to open stream: No such file or directory in /in/4sK5o on line 6 Warning: Invalid argument supplied for foreach() in /in/4sK5o on line 10 kokav2 - Work time MM:SS= 00:00 / 0km<br>
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.223122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): failed to open stream: Operation not permitted in /in/4sK5o on line 6 Warning: Invalid argument supplied for foreach() in /in/4sK5o on line 10 kokav - Work = 00:00 / 0km<br> Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4sK5o on line 6 Warning: file_get_contents(): open_basedir restriction in effect. File(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4sK5o on line 6 Warning: file_get_contents(https://www.waze.com/il-RoutingManager/routingRequest?from=x%3A34.993726+y%3A32.293122&to=x%3A34.793838+y%3A32.061679&at=0&returnJSON=true&timeout=60000&nPaths=1&clientVersion=4.0.0): failed to open stream: Operation not permitted in /in/4sK5o on line 6 Warning: Invalid argument supplied for foreach() in /in/4sK5o on line 10 kokav2 - Work time MM:SS= 00:00 / 0km<br>

preferences:
243.5 ms | 406 KiB | 373 Q