3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $Fecha = "2016-01-27 11:50:19"; function CalcularTiempo($Timestamp){ $Segundos = strtotime('now') - strtotime($Timestamp); return intval($Segundos); } function CalcularVelocidad($Distancia, $Tiempo){ $salida = $Distancia / $Tiempo; return $salida / 1000; } 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 $Velocidad; echo '\n'; echo floatval(7.6734156326455E-5); ?>
based on nnSUh
Output for 5.6.28, 7.0.20 - 7.2.0
6.9105095697467E-5\n7.6734156326455E-5
Output for 7.0.6
1.2025281732996E-8\n7.6734156326455E-5
Output for 7.0.5
2.0685097242118E-8\n7.6734156326455E-5
Output for 7.0.4
3.1851953292136E-8\n7.6734156326455E-5
Output for 7.0.3
2.6863415382901E-8\n7.6734156326455E-5
Output for 7.0.2
2.4813809086348E-8\n7.6734156326455E-5
Output for 7.0.1
2.4322636667363E-8\n7.6734156326455E-5
Output for 7.0.0
2.3090386540647E-8\n7.6734156326455E-5
Output for 5.6.21
1.4386273279761E-8\n7.6734156326455E-5
Output for 5.6.20
1.8735762769293E-8\n7.6734156326455E-5
Output for 5.6.19
3.3929606163321E-8\n7.6734156326455E-5
Output for 5.6.18
2.8733160966616E-8\n7.6734156326455E-5
Output for 5.6.17
2.6285176211698E-8\n7.6734156326455E-5
Output for 5.6.16
2.269869755629E-8\n7.6734156326455E-5
Output for 5.6.15
2.2319883896662E-8\n7.6734156326455E-5
Output for 5.6.14
1.7687105512763E-8\n7.6734156326455E-5
Output for 5.6.13
1.7457478514941E-8\n7.6734156326455E-5
Output for 5.6.12
1.6499224811341E-8\n7.6734156326455E-5
Output for 5.6.11
1.5700248082034E-8\n7.6734156326455E-5
Output for 5.6.10
1.5508920387534E-8\n7.6734156326455E-5
Output for 5.6.9
1.5131032441759E-8\n7.6734156326455E-5
Output for 5.6.8
1.4751741469584E-8\n7.6734156326455E-5
Output for 5.5.35
1.186605796748E-8\n7.6734156326455E-5
Output for 5.5.34
1.8462446064241E-8\n7.6734156326455E-5
Output for 5.5.33
3.3015777893384E-8\n7.6734156326455E-5
Output for 5.5.32
2.7495811421528E-8\n7.6734156326455E-5
Output for 5.5.31
2.5731782165556E-8\n7.6734156326455E-5
Output for 5.5.30
2.1264479246347E-8\n7.6734156326455E-5
Output for 5.5.29
1.7113434157669E-8\n7.6734156326455E-5
Output for 5.5.28
1.627814378286E-8\n7.6734156326455E-5
Output for 5.5.27
1.6076463306634E-8\n7.6734156326455E-5
Output for 5.5.26
1.5317898331267E-8\n7.6734156326455E-5
Output for 5.5.25
1.4935784666687E-8\n7.6734156326455E-5
Output for 5.5.24
1.1734801974579E-8\n7.6734156326455E-5
Output for 5.4.45
6.8905945565774E-5\n7.6734156326455E-5
Output for 5.4.44
6.8866253200816E-5\n7.6734156326455E-5
Output for 5.4.41 - 5.4.43
6.8787005498629E-5\n7.6734156326455E-5
Output for 5.4.40
6.8747450003805E-5\n7.6734156326455E-5
Output for 5.4.38 - 5.4.39
6.8707939975067E-5\n7.6734156326455E-5
Output for 5.4.36 - 5.4.37
6.8668475334071E-5\n7.6734156326455E-5
Output for 5.4.34 - 5.4.35
6.8629056002651E-5\n7.6734156326455E-5
Output for 5.3.29, 5.4.30 - 5.4.32
6.8589681902821E-5\n7.6734156326455E-5
Output for 5.4.26 - 5.4.29
6.8550352956776E-5\n7.6734156326455E-5
Output for 5.4.23 - 5.4.25
6.8511069086887E-5\n7.6734156326455E-5
Output for 5.3.28, 5.4.20 - 5.4.22
6.8471830215703E-5\n7.6734156326455E-5
Output for 5.3.26 - 5.3.27, 5.4.16 - 5.4.19
6.8432636265951E-5\n7.6734156326455E-5
Output for 5.3.22 - 5.3.25, 5.4.12 - 5.4.15
6.8393487160536E-5\n7.6734156326455E-5