3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php 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; } //echo CalcularDistancia(38.278096798610605,-0.6911851008339024,38.2788421664234,-0.6901980479164007); echo strtotime('now'); ?>
based on A1CJ8
Output for 5.6.28, 7.0.20 - 7.2.0
1453892440
Output for 7.0.6
1463833516
Output for 7.0.5
1459671422
Output for 7.0.4
1457645167
Output for 7.0.3
1458342164
Output for 7.0.2
1458709762
Output for 7.0.1
1458807058
Output for 7.0.0
1459069364
Output for 5.6.21
1462201940
Output for 5.6.20
1460272751
Output for 5.6.19
1457415333
Output for 5.6.18
1458052568
Output for 5.6.17
1458440066
Output for 5.6.16
1459158711
Output for 5.6.15
1459248101
Output for 5.6.14
1460651072
Output for 5.6.13
1460739980
Output for 5.6.12
1461137712
Output for 5.6.11
1461506454
Output for 5.6.10
1461600377
Output for 5.6.9
1461792909
Output for 5.6.8
1461996060
Output for 5.5.35
1463966901
Output for 5.5.34
1460367214
Output for 5.5.33
1457512860
Output for 5.5.32
1458239808
Output for 5.5.31
1458537880
Output for 5.5.30
1459513946
Output for 5.5.29
1460877655
Output for 5.5.28
1461236110
Output for 5.5.27
1461328260
Output for 5.5.26
1461696522
Output for 5.5.25
1461896197
Output for 5.5.24
1464079608
Output for 5.4.45
1453892444
Output for 5.4.44
1453892445
Output for 5.4.43
1453892447
Output for 5.4.42
1453892448
Output for 5.4.41
1453892449
Output for 5.4.40
1453892450
Output for 5.4.39
1453892452
Output for 5.4.38
1453892453
Output for 5.4.36 - 5.4.37
1453892454
Output for 5.4.35
1453892455
Output for 5.4.34
1453892456
Output for 5.3.29, 5.4.31 - 5.4.32
1453892457
Output for 5.4.29 - 5.4.30
1453892458
Output for 5.4.26 - 5.4.28
1453892459
Output for 5.4.24 - 5.4.25
1453892460
Output for 5.3.28, 5.4.23
1453892461
Output for 5.4.21 - 5.4.22
1453892462
Output for 5.4.19 - 5.4.20
1453892463
Output for 5.3.27, 5.4.17 - 5.4.18
1453892464
Output for 5.3.23 - 5.3.26, 5.4.13 - 5.4.16
1453892465
Output for 5.3.22, 5.4.12
1453892466