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; } 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'; ?>
based on 9D6O1
Output for 5.6.28, 7.0.20 - 7.2.0
0.065687810745394\n
Output for 7.0.6
1.2025273265947E-5\n
Output for 7.0.5
2.0685072189307E-5\n
Output for 7.0.4
3.1851953292136E-5\n
Output for 7.0.3
2.6863409346666E-5\n
Output for 7.0.2
2.4813803936071E-5\n
Output for 7.0.1
2.4322636667363E-5\n
Output for 7.0.0
2.309042221835E-5\n
Output for 5.6.21
1.4386261161562E-5\n
Output for 5.6.20
1.8735742215871E-5\n
Output for 5.6.19
3.3929596533875E-5\n
Output for 5.6.18
2.8733154060871E-5\n
Output for 5.6.17
2.6285170432527E-5\n
Output for 5.6.16
2.2698723414439E-5\n
Output for 5.6.15
2.2319904731882E-5\n
Output for 5.6.14
1.7687089812453E-5\n
Output for 5.6.13
1.7457460670438E-5\n
Output for 5.6.12
1.6499211149104E-5\n
Output for 5.6.11
1.5700235710949E-5\n
Output for 5.6.10
1.5508906304228E-5\n
Output for 5.6.9
1.5131019036396E-5\n
Output for 5.6.8
1.4751730548108E-5\n
Output for 5.5.35
1.1866033234574E-5\n
Output for 5.5.34
1.8462428957269E-5\n
Output for 5.5.33
3.3015768775653E-5\n
Output for 5.5.32
2.7495811421528E-5\n
Output for 5.5.31
2.5731776627167E-5\n
Output for 5.5.30
2.1264452770441E-5\n
Output for 5.5.29
1.711342190903E-5\n
Output for 5.5.28
1.6278128267881E-5\n
Output for 5.5.27
1.6076450335565E-5\n
Output for 5.5.26
1.5317886555394E-5\n
Output for 5.5.25
1.4935771605052E-5\n
Output for 5.5.24
1.1734793911645E-5\n
Output for 5.4.45
0.065436133309588\n
Output for 5.4.44
0.065400336737756\n
Output for 5.4.41 - 5.4.43
0.0653288609599\n
Output for 5.4.40
0.065257541242695\n
Output for 5.4.38 - 5.4.39
0.0652219397472\n
Output for 5.4.36 - 5.4.37
0.065150853164369\n
Output for 5.4.34 - 5.4.35
0.065115367950227\n
Output for 5.3.29, 5.4.32
0.06507992136996\n
Output for 5.4.28 - 5.4.31
0.06504451336051\n
Output for 5.4.25 - 5.4.27
0.065009143858954\n
Output for 5.3.28, 5.4.23 - 5.4.24
0.064973812802509\n
Output for 5.4.20 - 5.4.22
0.064938520128526\n
Output for 5.4.19
0.064903265774494\n
Output for 5.3.27, 5.4.17 - 5.4.18
0.064868049678034\n
Output for 5.3.25 - 5.3.26, 5.4.15 - 5.4.16
0.064832871776907\n
Output for 5.3.22 - 5.3.24, 5.4.12 - 5.4.14
0.064797732009007\n