3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $Fecha = "2016-01-27 11:50:19"; function CalcularTiempo($Timestamp){ $Segundos = strtotime('now') - strtotime($Timestamp); return intval($Segundos); } function CalcularVelocidad($Distancia, $Tiempo){ $salida = $Distancia / $Tiempo; return $salida / 1000; } 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 $Velocidad; echo '\n'; echo round(7.6734156326455E-5); ?>
based on vk3U9
Output for 5.6.28, 7.0.20 - 7.2.0
7.5665706048492E-5\n0
Output for 7.0.6
1.2025276894681E-8\n0
Output for 7.0.5
2.0685079347247E-8\n0
Output for 7.0.4
3.185197026465E-8\n0
Output for 7.0.3
2.6863421419139E-8\n0
Output for 7.0.2
2.4813819386909E-8\n0
Output for 7.0.1
2.4322641615767E-8\n0
Output for 7.0.0
2.3090431137793E-8\n0
Output for 5.6.21
1.4386266355073E-8\n0
Output for 5.6.20
1.8735748088272E-8\n0
Output for 5.6.19
3.3929615792774E-8\n0
Output for 5.6.18
2.8733167872364E-8\n0
Output for 5.6.17
2.6285187770047E-8\n0
Output for 5.6.16
2.2698727724137E-8\n0
Output for 5.6.15
2.2319867228513E-8\n0
Output for 5.6.14
1.7687095045886E-8\n0
Output for 5.6.13
1.7457468318077E-8\n0
Output for 5.6.12
1.6499215703181E-8\n0
Output for 5.6.11
1.5700239834642E-8\n0
Output for 5.6.10
1.5508912339928E-8\n0
Output for 5.6.9
1.5131024781549E-8\n0
Output for 5.6.8
1.4751734188598E-8\n0
Output for 5.5.35
1.1866041478864E-8\n0
Output for 5.5.34
1.8462434659589E-8\n0
Output for 5.5.33
3.301578701112E-8\n0
Output for 5.5.32
2.7495824069099E-8\n0
Output for 5.5.31
2.5731793242341E-8\n0
Output for 5.5.30
2.126446411725E-8\n0
Output for 5.5.29
1.7113426808483E-8\n0
Output for 5.5.28
1.6278134917154E-8\n0
Output for 5.5.27
1.6076454659253E-8\n0
Output for 5.5.26
1.5317890480683E-8\n0
Output for 5.5.25
1.4935777202893E-8\n0
Output for 5.5.24
1.1734797367187E-8\n0
Output for 5.4.45
7.5474631033218E-5\n0
Output for 5.4.44
7.5427012969475E-5\n0
Output for 5.4.42 - 5.4.43
7.5331956872475E-5\n0
Output for 5.4.41
7.5284518612479E-5\n0
Output for 5.4.40
7.5237140060804E-5\n0
Output for 5.4.38 - 5.4.39
7.5189821104791E-5\n0
Output for 5.4.37
7.5142561632066E-5\n0
Output for 5.4.36
7.5095361530538E-5\n0
Output for 5.4.35
7.5048220688398E-5\n0
Output for 5.4.34
7.5001138994114E-5\n0
Output for 5.3.29, 5.4.31 - 5.4.32
7.4907152604397E-5\n0
Output for 5.4.29 - 5.4.30
7.4860247687299E-5\n0
Output for 5.4.27 - 5.4.28
7.4813401474729E-5\n0
Output for 5.4.25 - 5.4.26
7.4766613856546E-5\n0
Output for 5.4.24
7.4719884722886E-5\n0
Output for 5.3.28, 5.4.23
7.4673213964158E-5\n0
Output for 5.4.20 - 5.4.22
7.4626601471047E-5\n0
Output for 5.4.18 - 5.4.19
7.4580047134509E-5\n0
Output for 5.3.27, 5.4.17
7.4533550845771E-5\n0
Output for 5.3.24 - 5.3.26, 5.4.14 - 5.4.16
7.4487112496335E-5\n0
Output for 5.3.22 - 5.3.23, 5.4.12 - 5.4.13
7.4440731977968E-5\n0