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 $Tiempo; ?>
based on XeCvN
Output for 5.6.28, 7.0.20 - 7.2.0
1453892638
Output for 7.0.6
1463833518
Output for 7.0.5
1459671424
Output for 7.0.4
1457645168
Output for 7.0.3
1458342165
Output for 7.0.2
1458709763
Output for 7.0.1
1458807059
Output for 7.0.0
1459069357
Output for 5.6.21
1462201942
Output for 5.6.20
1460272754
Output for 5.6.19
1457415334
Output for 5.6.18
1458052569
Output for 5.6.17
1458440068
Output for 5.6.16
1459158705
Output for 5.6.15
1459248103
Output for 5.6.14
1460651075
Output for 5.6.13
1460739983
Output for 5.6.12
1461137715
Output for 5.6.11
1461506456
Output for 5.6.10
1461600380
Output for 5.6.9
1461792912
Output for 5.6.8
1461996063
Output for 5.5.35
1463966904
Output for 5.5.34
1460367216
Output for 5.5.33
1457512861
Output for 5.5.32
1458239809
Output for 5.5.31
1458537881
Output for 5.5.30
1459513948
Output for 5.5.29
1460877658
Output for 5.5.28
1461236113
Output for 5.5.27
1461328262
Output for 5.5.26
1461696524
Output for 5.5.25
1461896199
Output for 5.5.24
1464079612
Output for 5.4.44 - 5.4.45
1453892640
Output for 5.4.41 - 5.4.43
1453892642
Output for 5.4.40
1453892643
Output for 5.4.38 - 5.4.39
1453892644
Output for 5.4.36 - 5.4.37
1453892645
Output for 5.4.34 - 5.4.35
1453892646
Output for 5.3.29, 5.4.31 - 5.4.32
1453892647
Output for 5.4.28 - 5.4.30
1453892648
Output for 5.4.25 - 5.4.27
1453892649
Output for 5.3.28, 5.4.22 - 5.4.24
1453892650
Output for 5.4.19 - 5.4.21
1453892651
Output for 5.3.26 - 5.3.27, 5.4.16 - 5.4.18
1453892652
Output for 5.3.22 - 5.3.25, 5.4.12 - 5.4.15
1453892653