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 git.master, git.master_jit
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 rfc.property-hooks
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>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.62 ms | 409 KiB | 8 Q