3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $Fecha = 1453892442; function CalcularTiempo($Timestamp){ $Segundos = strtotime('now') - strtotime($Timestamp); return $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 $Tiempo; ?>
based on ePI3R
Output for 5.6.28, 7.0.20 - 7.2.0
1453892787
Output for 7.0.6
1463833520
Output for 7.0.5
1459671426
Output for 7.0.4
1457645169
Output for 7.0.3
1458342166
Output for 7.0.2
1458709764
Output for 7.0.1
1458807060
Output for 7.0.0
1459069357
Output for 5.6.21
1462201945
Output for 5.6.20
1460272757
Output for 5.6.19
1457415335
Output for 5.6.18
1458052570
Output for 5.6.17
1458440068
Output for 5.6.16
1459158706
Output for 5.6.15
1459248096
Output for 5.6.14
1460651078
Output for 5.6.13
1460739986
Output for 5.6.12
1461137718
Output for 5.6.11
1461506459
Output for 5.6.10
1461600383
Output for 5.6.9
1461792915
Output for 5.6.8
1461996065
Output for 5.5.35
1463966909
Output for 5.5.34
1460367219
Output for 5.5.33
1457512862
Output for 5.5.32
1458239810
Output for 5.5.31
1458537884
Output for 5.5.30
1459513951
Output for 5.5.29
1460877660
Output for 5.5.28
1461236115
Output for 5.5.27
1461328265
Output for 5.5.26
1461696527
Output for 5.5.25
1461896202
Output for 5.5.24
1464079615
Output for 5.4.45
1453892791
Output for 5.4.44
1453892792
Output for 5.4.42 - 5.4.43
1453892793
Output for 5.4.41
1453892794
Output for 5.4.40
1453892795
Output for 5.4.39
1453892796
Output for 5.4.37 - 5.4.38
1453892797
Output for 5.4.34 - 5.4.36
1453892798
Output for 5.3.29, 5.4.31 - 5.4.32
1453892799
Output for 5.4.29 - 5.4.30
1453892800
Output for 5.4.25 - 5.4.28
1453892801
Output for 5.3.28, 5.4.23 - 5.4.24
1453892802
Output for 5.4.20 - 5.4.22
1453892803
Output for 5.3.27, 5.4.17 - 5.4.19
1453892804
Output for 5.3.24 - 5.3.26, 5.4.14 - 5.4.16
1453892805
Output for 5.3.22 - 5.3.23, 5.4.12 - 5.4.13
1453892806