3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Fecha = "2016-01-27 11:50:19"; function CalcularTiempo($Timestamp){ $Segundos = strtotime('now') - strtotime($Timestamp); return intval($Segundos); } function CalcularVelocidad($Distancia, $Tiempo){ $Velocidad = $Distancia / $Tiempo; $Velocidad = ($Velocidad / 1000) / 3600; 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 $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.0100.01019.43
8.3.30.0070.00719.20
8.3.20.0040.01120.70
8.3.10.0060.00321.06
8.3.00.0050.00321.13
8.2.170.0070.00722.96
8.2.160.0080.00822.50
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00421.44
8.2.120.0070.00026.35
8.2.110.0060.00321.21
8.2.100.0040.00818.43
8.2.90.0040.00419.47
8.2.80.0030.00518.25
8.2.70.0000.00818.25
8.2.60.0060.00618.30
8.2.50.0000.00818.25
8.2.40.0060.00320.91
8.2.30.0080.00020.12
8.2.20.0040.00418.21
8.2.10.0050.00218.63
8.2.00.0000.00718.63
8.1.270.0110.00324.41
8.1.260.0040.00428.09
8.1.250.0000.00828.09
8.1.240.0090.00022.94
8.1.230.0060.00618.33
8.1.220.0050.00318.16
8.1.210.0000.00818.77
8.1.200.0060.00317.98
8.1.190.0040.00417.86
8.1.180.0040.00418.10
8.1.170.0080.00018.97
8.1.160.0030.00621.17
8.1.150.0050.00321.04
8.1.140.0040.00420.01
8.1.130.0030.00318.05
8.1.120.0050.00218.07
8.1.110.0020.00518.06
8.1.100.0040.00417.91
8.1.90.0000.00718.02
8.1.80.0040.00418.02
8.1.70.0000.00817.95
8.1.60.0000.00818.18
8.1.50.0050.00318.13
8.1.40.0060.00618.16
8.1.30.0050.00318.12
8.1.20.0030.00518.08
8.1.10.0040.00418.00
8.1.00.0050.00318.09
8.0.300.0080.00018.77
8.0.290.0050.00317.38
8.0.280.0070.00019.07
8.0.270.0030.00317.70
8.0.260.0000.00617.65
8.0.250.0030.00317.50
8.0.240.0030.00317.48
8.0.230.0000.00717.66
8.0.220.0040.00417.63
8.0.210.0040.00417.53
8.0.200.0040.00417.59
8.0.190.0030.00517.53
8.0.180.0040.00417.37
8.0.170.0000.00717.54
8.0.160.0000.00717.55
8.0.150.0030.00517.39
8.0.140.0000.00817.44
8.0.130.0050.00013.87
8.0.120.0030.00617.32
8.0.110.0000.00717.52
8.0.100.0070.00017.39
8.0.90.0000.00717.43
8.0.80.0110.00317.25
8.0.70.0040.00417.35
8.0.60.0070.00017.34
8.0.50.0000.00717.47
8.0.30.0080.01017.39
8.0.20.0090.01217.71
8.0.10.0040.00417.63
8.0.00.0100.00817.24
7.4.330.0050.00017.08
7.4.320.0030.00317.18
7.4.300.0030.00317.09
7.4.290.0000.00717.19
7.4.280.0030.00617.17
7.4.270.0030.00317.02
7.4.260.0030.00817.18
7.4.250.0050.00217.18
7.4.240.0030.00317.20
7.4.230.0000.00717.11
7.4.220.0060.01216.99
7.4.210.0100.01016.99
7.4.200.0030.00317.09
7.4.160.0110.00416.91
7.4.150.0170.00817.40
7.4.140.0130.00817.86
7.4.130.0090.00816.99
7.4.120.0110.00816.88
7.4.110.0090.01216.96
7.4.100.0160.00317.00
7.4.90.0150.00316.95
7.4.80.0160.00319.39
7.4.70.0100.01016.78
7.4.60.0090.01316.99
7.4.50.0090.00617.44
7.4.40.0100.00716.99
7.4.30.0120.00616.86
7.4.00.0040.01215.60
7.3.330.0060.00013.97
7.3.320.0030.00313.70
7.3.310.0030.00316.98
7.3.300.0030.00516.87
7.3.290.0100.00916.73
7.3.280.0070.01016.73
7.3.270.0120.00917.40
7.3.260.0070.01017.01
7.3.250.0090.01116.83
7.3.240.0050.01516.81
7.3.230.0130.00516.83
7.3.210.0140.00317.02
7.3.200.0060.01117.03
7.3.190.0080.00817.04
7.3.180.0060.01116.82
7.3.170.0070.01416.78
7.3.160.0030.01316.66
7.2.330.0150.00917.16
7.2.320.0150.00816.81
7.2.310.0100.00717.08
7.2.300.0140.01016.87
7.2.290.0030.01317.27
7.2.60.0090.00617.44
7.2.00.0040.01119.91
7.1.200.0060.00916.46
7.1.100.0050.00518.40
7.1.70.0030.01317.84
7.1.60.0100.01319.27
7.1.50.0030.01917.48
7.1.00.0030.07722.82
7.0.200.0470.00315.18
7.0.60.0030.07022.05
7.0.50.0100.07718.19
7.0.40.0100.05720.28
7.0.30.0200.07320.46
7.0.20.0300.04720.49
7.0.10.0200.06320.52
7.0.00.0030.08720.45
5.6.280.0100.05021.36
5.6.210.0170.06721.04
5.6.200.0030.04318.53
5.6.190.0130.07321.02
5.6.180.0300.06020.83
5.6.170.0300.04320.88
5.6.160.0000.04720.90
5.6.150.0100.05318.50
5.6.140.0130.07718.43
5.6.130.0070.04018.51
5.6.120.0030.04721.38
5.6.110.0100.06721.37
5.6.100.0100.07021.28
5.6.90.0200.07021.36
5.6.80.0070.03720.64
5.5.350.3300.03320.79
5.5.340.0100.08318.22
5.5.330.0000.05020.82
5.5.320.0230.03320.58
5.5.310.0230.08020.52
5.5.300.0100.07318.16
5.5.290.0070.08318.27
5.5.280.0070.07721.06
5.5.270.0000.08721.16
5.5.260.0030.08721.13
5.5.250.0100.06720.94
5.5.240.0030.04020.56

preferences:
82.8 ms | 400 KiB | 5 Q