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 $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 38Wbi
Output for 5.6.28, 7.0.20 - 7.2.0
2005
Output for 7.0.6
9942656
Output for 7.0.5
5780562
Output for 7.0.4
3754311
Output for 7.0.3
4451309
Output for 7.0.2
4818906
Output for 7.0.1
4916202
Output for 7.0.0
5178499
Output for 5.6.21
8311080
Output for 5.6.20
6381891
Output for 5.6.19
3524477
Output for 5.6.18
4161712
Output for 5.6.17
4549211
Output for 5.6.16
5267848
Output for 5.6.15
5357238
Output for 5.6.14
6760213
Output for 5.6.13
6849121
Output for 5.6.12
7246853
Output for 5.6.11
7615594
Output for 5.6.10
7709518
Output for 5.6.9
7902050
Output for 5.6.8
8105200
Output for 5.5.35
10076041
Output for 5.5.34
6476354
Output for 5.5.33
3622004
Output for 5.5.32
4348952
Output for 5.5.31
4647027
Output for 5.5.30
5623086
Output for 5.5.29
6986795
Output for 5.5.28
7345250
Output for 5.5.27
7437400
Output for 5.5.26
7805662
Output for 5.5.25
8005337
Output for 5.5.24
10188748
Output for 5.4.45
2008
Output for 5.4.44
2009
Output for 5.4.41 - 5.4.43
2010
Output for 5.4.40
2011
Output for 5.4.38 - 5.4.39
2012
Output for 5.4.36 - 5.4.37
2013
Output for 5.4.34 - 5.4.35
2014
Output for 5.3.29, 5.4.31 - 5.4.32
2015
Output for 5.4.27 - 5.4.30
2016
Output for 5.4.24 - 5.4.26
2017
Output for 5.4.23
2018
Output for 5.3.28, 5.4.21 - 5.4.22
2019
Output for 5.4.20
2020
Output for 5.4.18 - 5.4.19
2021
Output for 5.3.27, 5.4.17
2022
Output for 5.3.25 - 5.3.26, 5.4.15 - 5.4.16
2023
Output for 5.3.24, 5.4.13 - 5.4.14
2024
Output for 5.3.22 - 5.3.23, 5.4.12
2025