3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Fecha = "2016-01-27 12:05:19"; function CalcularTiempo($Timestamp){ //$Segundos = 1453894620 - 1453894620; return intval($Segundos); } function CalcularVelocidad($Distancia, $Tiempo){ $Velocidad = $Distancia / $Tiempo; $Velocidad = $Velocidad * 3.6; return $Velocidad; } function CalcularDistancia($OrigenLat, $OrigenLon, $DestinoLat, $DestinoLon){ $R = 6371; $dLat = ($DestinoLat - $OrigenLat) * (pi() / 180); $dLon = ($DestinoLon - $OrigenLon) * (pi() / 180); $a = sin($dLat / 2) * sin($dLat / 2) + cos($OrigenLat * (pi() / 180)) * cos($DestinoLat * (pi() / 180)) * sin($dLon / 2) * sin($dLon / 2); $c = 2 * atan2(sqrt($a), sqrt(1 - $a)); return ($R * $c) * 1000; } $Tiempo = CalcularTiempo($Fecha); $Distancia = CalcularDistancia(38.278096798610605,-0.6911851008339024,38.2788421664234,-0.6901980479164007); $Velocidad = CalcularVelocidad($Distancia, $Tiempo); echo strtotime('now'); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $Segundos in /in/rElCQ on line 7 Fatal error: Uncaught DivisionByZeroError: Division by zero in /in/rElCQ:11 Stack trace: #0 /in/rElCQ(29): CalcularVelocidad(119.55181555662, 0) #1 {main} thrown in /in/rElCQ on line 11
Process exited with code 255.

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:
48.69 ms | 401 KiB | 8 Q