3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $Fecha = "2016-01-27 11:34:19"; 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 4ZJ8v
Output for 5.6.28, 7.0.20 - 7.2.0
2018
Output for 7.0.6
9942664
Output for 7.0.5
5780569
Output for 7.0.4
3754312
Output for 7.0.3
4451310
Output for 7.0.2
4818907
Output for 7.0.1
4916203
Output for 7.0.0
5178500
Output for 5.6.21
8311089
Output for 5.6.20
6381900
Output for 5.6.19
3524479
Output for 5.6.18
4161714
Output for 5.6.17
4549212
Output for 5.6.16
5267849
Output for 5.6.15
5357239
Output for 5.6.14
6760222
Output for 5.6.13
6849130
Output for 5.6.12
7246862
Output for 5.6.11
7615603
Output for 5.6.10
7709542
Output for 5.6.9
7902059
Output for 5.6.8
8105209
Output for 5.5.35
10076060
Output for 5.5.34
6476363
Output for 5.5.33
3622005
Output for 5.5.32
4348953
Output for 5.5.31
4647028
Output for 5.5.30
5623095
Output for 5.5.29
6986804
Output for 5.5.28
7345273
Output for 5.5.27
7437408
Output for 5.5.26
7805671
Output for 5.5.25
8005346
Output for 5.5.24
10188758
Output for 5.4.45
2025
Output for 5.4.44
2026
Output for 5.4.42 - 5.4.43
2028
Output for 5.4.41
2029
Output for 5.4.40
2030
Output for 5.4.38 - 5.4.39
2032
Output for 5.4.37
2033
Output for 5.4.36
2034
Output for 5.4.34 - 5.4.35
2036
Output for 5.4.32
2038
Output for 5.3.29, 5.4.31
2039
Output for 5.4.29 - 5.4.30
2040
Output for 5.4.28
2041
Output for 5.4.26 - 5.4.27
2042
Output for 5.4.24 - 5.4.25
2043
Output for 5.4.23
2044
Output for 5.3.28, 5.4.21 - 5.4.22
2045
Output for 5.4.20
2046
Output for 5.4.18 - 5.4.19
2047
Output for 5.3.27, 5.4.17
2048
Output for 5.3.24 - 5.3.26, 5.4.14 - 5.4.16
2049
Output for 5.3.22 - 5.3.23, 5.4.12 - 5.4.13
2050