3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $Fecha = 1453892442; function CalcularTiempo($Timestamp){ $Segundos = strtotime('now') - strtotime($Timestamp); return intval($Segundos); } function CalcularVelocidad($Distancia, $Tiempo){ return $Distancia / $Tiempo; } 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; ?>
based on v4kTi
Output for 5.6.28, 7.0.20 - 7.2.0
8.2228786267792E-8
Output for 7.0.6
8.1670363581802E-8
Output for 7.0.5
8.1903237723807E-8
Output for 7.0.4
8.2017090428565E-8
Output for 7.0.3
8.1977891352142E-8
Output for 7.0.2
8.1957232747072E-8
Output for 7.0.1
8.1951766560939E-8
Output for 7.0.0
8.1937034086142E-8
Output for 5.6.21
8.1761494226205E-8
Output for 5.6.20
8.1869510549319E-8
Output for 5.6.19
8.2030024501318E-8
Output for 5.6.18
8.1994173665913E-8
Output for 5.6.17
8.1972388349515E-8
Output for 5.6.16
8.193201642387E-8
Output for 5.6.15
8.1926997467232E-8
Output for 5.6.14
8.1848305652646E-8
Output for 5.6.13
8.1843323952104E-8
Output for 5.6.12
8.1821045621588E-8
Output for 5.6.11
8.1800401952256E-8
Output for 5.6.10
8.1795145427105E-8
Output for 5.6.9
8.1784372230149E-8
Output for 5.6.8
8.1773007919783E-8
Output for 5.5.35
8.1662922373196E-8
Output for 5.5.34
8.186421486787E-8
Output for 5.5.33
8.2024535601417E-8
Output for 5.5.32
8.1983645501079E-8
Output for 5.5.31
8.1966891031072E-8
Output for 5.5.30
8.1912074715313E-8
Output for 5.5.29
8.1835610931393E-8
Output for 5.5.28
8.1815535884195E-8
Output for 5.5.27
8.1810376672656E-8
Output for 5.5.26
8.1789765300425E-8
Output for 5.5.25
8.1778593938595E-8
Output for 5.5.24
8.1656635897193E-8
Output for 5.4.44 - 5.4.45
8.2228786041561E-8
Output for 5.4.43
8.2228785985004E-8
Output for 5.4.41 - 5.4.42
8.2228785928446E-8
Output for 5.4.40
8.2228785871888E-8
Output for 5.4.38 - 5.4.39
8.2228785815331E-8
Output for 5.4.36 - 5.4.37
8.2228785758773E-8
Output for 5.4.34 - 5.4.35
8.2228785702215E-8
Output for 5.3.29, 5.4.30 - 5.4.32
8.2228785645658E-8
Output for 5.4.26 - 5.4.29
8.22287855891E-8
Output for 5.4.23 - 5.4.25
8.2228785532542E-8
Output for 5.3.28, 5.4.20 - 5.4.22
8.2228785475985E-8
Output for 5.3.27, 5.4.17 - 5.4.19
8.2228785419427E-8
Output for 5.3.24 - 5.3.26, 5.4.14 - 5.4.16
8.2228785362869E-8
Output for 5.3.22 - 5.3.23, 5.4.12 - 5.4.13
8.2228785306312E-8