3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Fecha = "2016-01-27 11:00:19"; function CalcularTiempo($Timestamp){ $Segundos = strtotime('now') - strtotime($Timestamp); return intval($Segundos); } function CalcularVelocidad($Distancia, $Tiempo){ return ($Distancia / $Tiempo) / 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; ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.40.0180.00319.19
8.3.30.0080.00819.20
8.3.20.0050.00320.89
8.3.10.0040.00421.29
8.3.00.0000.00820.97
8.2.170.0090.00622.96
8.2.160.0070.00722.50
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0080.00021.49
8.2.120.0040.00426.35
8.2.110.0070.00321.46
8.2.100.0070.00318.43
8.2.90.0040.00419.64
8.2.80.0040.00418.13
8.2.70.0050.00318.38
8.2.60.0000.00718.43
8.2.50.0030.00618.13
8.2.40.0000.00921.07
8.2.30.0030.00620.02
8.2.20.0050.00318.28
8.2.10.0080.00018.75
8.2.00.0000.00818.59
8.1.270.0000.00824.17
8.1.260.0050.00328.09
8.1.250.0080.00028.09
8.1.240.0090.00022.86
8.1.230.0030.00718.14
8.1.220.0050.00318.16
8.1.210.0030.00518.77
8.1.200.0090.00017.88
8.1.190.0040.00417.97
8.1.180.0040.00418.10
8.1.170.0000.00919.16
8.1.160.0030.00521.15
8.1.150.0040.00419.29
8.1.140.0030.00620.19
8.1.130.0000.00718.18
8.1.120.0000.00818.10
8.1.110.0060.00317.88
8.1.100.0060.00318.02
8.1.90.0040.00418.02
8.1.80.0000.00718.01
8.1.70.0070.00018.05
8.1.60.0000.00818.19
8.1.50.0060.00318.10
8.1.40.0030.00918.09
8.1.30.0090.00018.05
8.1.20.0040.00418.08
8.1.10.0030.00518.07
8.1.00.0050.00318.10
8.0.300.0000.00718.77
8.0.290.0030.00617.50
8.0.280.0040.00418.98
8.0.270.0030.00517.82
8.0.260.0030.00317.82
8.0.250.0000.00717.63
8.0.240.0000.00817.50
8.0.230.0000.00717.51
8.0.220.0030.00617.52
8.0.210.0040.00417.38
8.0.200.0000.00617.51
8.0.190.0050.00317.63
8.0.180.0030.00617.41
8.0.170.0000.00717.52
8.0.160.0050.00217.44
8.0.150.0040.00417.35
8.0.140.0000.00817.27
8.0.130.0000.00513.79
8.0.120.0030.00617.49
8.0.110.0000.00717.48
8.0.100.0040.00417.37
8.0.90.0040.00417.42
8.0.80.0130.00617.22
8.0.70.0040.00417.40
8.0.60.0000.00717.60
8.0.50.0050.00217.54
8.0.30.0090.01117.52
8.0.20.0090.01017.54
8.0.10.0000.00717.72
8.0.00.0100.01017.04
7.4.330.0000.00517.08
7.4.320.0070.00017.08
7.4.300.0000.00716.90
7.4.290.0000.00716.94
7.4.280.0040.00417.11
7.4.270.0070.00017.23
7.4.260.0040.00417.16
7.4.250.0040.00417.16
7.4.240.0000.00817.09
7.4.230.0030.00316.94
7.4.220.0170.01016.89
7.4.210.0090.00917.07
7.4.200.0020.00516.85
7.4.160.0060.00917.02
7.4.150.0300.01617.40
7.4.140.0100.01117.86
7.4.130.0180.00017.11
7.4.120.0110.00716.95
7.4.110.0070.01116.95
7.4.100.0070.01616.90
7.4.90.0170.00316.88
7.4.80.0090.01519.39
7.4.70.0080.00816.99
7.4.60.0120.00416.90
7.4.50.0000.01517.21
7.4.40.0090.00616.95
7.4.30.0150.00416.98
7.4.00.0000.01715.68
7.3.330.0000.00613.92
7.3.320.0040.00413.91
7.3.310.0000.00616.95
7.3.300.0050.00216.86
7.3.290.0060.01016.70
7.3.280.0130.00716.71
7.3.270.0060.01217.40
7.3.260.0070.01217.02
7.3.240.0110.00816.96
7.3.230.0110.00516.92
7.3.210.0110.00716.75
7.3.200.0070.01516.71
7.3.190.0100.00716.81
7.3.180.0130.00317.23
7.3.170.0090.01216.81
7.3.160.0000.01816.83
7.2.330.0100.00717.20
7.2.320.0080.00817.00
7.2.310.0170.00617.13
7.2.300.0110.00617.17
7.2.290.0070.01017.15
7.2.60.0000.01517.57
7.2.00.0000.01119.95
7.1.200.0040.00716.40
7.1.100.0030.00918.35
7.1.70.0070.01017.43
7.1.60.0090.01219.27
7.1.50.0060.00617.26
7.1.00.0070.07322.66
7.0.200.0490.00715.25
7.0.60.0130.07322.07
7.0.50.0000.04318.15
7.0.40.0070.05020.36
7.0.30.0170.05320.46
7.0.20.0370.07720.48
7.0.10.0100.03720.34
7.0.00.0130.03720.49
5.6.280.0030.03321.18
5.6.210.0100.05020.82
5.6.200.0070.06718.45
5.6.190.0130.04720.84
5.6.180.0370.08020.65
5.6.170.0300.08020.70
5.6.160.0130.06020.77
5.6.150.0030.05718.53
5.6.140.0130.05718.47
5.6.130.0070.08318.49
5.6.120.0230.06721.33
5.6.110.0100.08021.37
5.6.100.0170.07721.42
5.6.90.0100.08021.25
5.6.80.0030.04020.78
5.5.350.3430.05020.57
5.5.340.0100.07018.16
5.5.330.0070.03720.82
5.5.320.0270.05020.51
5.5.310.0300.08020.57
5.5.300.0070.05018.20
5.5.290.0030.05318.23
5.5.280.0070.08721.10
5.5.270.0070.03721.00
5.5.260.0030.09321.16
5.5.250.0030.07720.97
5.5.240.0070.07720.62

preferences:
55.91 ms | 400 KiB | 5 Q