3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $Fecha = "2016-01-27 12:05:19"; function CalcularTiempo($Timestamp){ $Segundos = strtotime('now') - strtotime($Timestamp); return intval($Segundos); } function CalcularVelocidad($Distancia, $Tiempo){ $Velocidad = $Distancia / $Tiempo; $Velocidad = $Velocidad * 3.6; return $Velocidad; } 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 strtotime('now'); ?>
based on aS2IY
Output for 5.6.28, 7.0.20 - 7.2.0
1453894619
Output for 7.0.6
1463833539
Output for 7.0.5
1459671445
Output for 7.0.4
1457645187
Output for 7.0.3
1458342187
Output for 7.0.2
1458709784
Output for 7.0.1
1458807077
Output for 7.0.0
1459069378
Output for 5.6.21
1462201964
Output for 5.6.20
1460272776
Output for 5.6.19
1457415353
Output for 5.6.18
1458052590
Output for 5.6.17
1458440089
Output for 5.6.16
1459158723
Output for 5.6.15
1459248124
Output for 5.6.14
1460651102
Output for 5.6.13
1460740005
Output for 5.6.12
1461137738
Output for 5.6.11
1461506479
Output for 5.6.10
1461600418
Output for 5.6.9
1461792935
Output for 5.6.8
1461996085
Output for 5.5.35
1463966974
Output for 5.5.34
1460367239
Output for 5.5.33
1457512880
Output for 5.5.32
1458239828
Output for 5.5.31
1458537905
Output for 5.5.30
1459513971
Output for 5.5.29
1460877678
Output for 5.5.28
1461236149
Output for 5.5.27
1461328283
Output for 5.5.26
1461696546
Output for 5.5.25
1461896222
Output for 5.5.24
1464079632
Output for 5.4.45
1453894622
Output for 5.4.44
1453894623
Output for 5.4.42 - 5.4.43
1453894624
Output for 5.4.40 - 5.4.41
1453894625
Output for 5.4.38 - 5.4.39
1453894626
Output for 5.4.36 - 5.4.37
1453894627
Output for 5.4.34 - 5.4.35
1453894628
Output for 5.3.29, 5.4.29 - 5.4.32
1453894629
Output for 5.4.27 - 5.4.28
1453894630
Output for 5.4.24 - 5.4.26
1453894631
Output for 5.3.28, 5.4.23
1453894632
Output for 5.4.20 - 5.4.22
1453894633
Output for 5.4.18 - 5.4.19
1453894634
Output for 5.3.26 - 5.3.27, 5.4.17
1453894635
Output for 5.3.24 - 5.3.25, 5.4.14 - 5.4.16
1453894636
Output for 5.3.22 - 5.3.23, 5.4.12 - 5.4.13
1453894637