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 * (1/1000) * 3600 / 1; 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.0060.00919.52
8.3.30.0090.00619.21
8.3.20.0060.00320.66
8.3.10.0080.00021.11
8.3.00.0040.00420.96
8.2.170.0120.00322.96
8.2.160.0000.01521.05
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00021.62
8.2.120.0080.00026.35
8.2.110.0050.00521.43
8.2.100.0060.00618.30
8.2.90.0040.00419.43
8.2.80.0000.00818.13
8.2.70.0050.00318.13
8.2.60.0060.00318.30
8.2.50.0090.00018.12
8.2.40.0040.00420.89
8.2.30.0050.00319.92
8.2.20.0030.00518.31
8.2.10.0000.00818.64
8.2.00.0040.00418.55
8.1.270.0080.00024.18
8.1.260.0000.00828.09
8.1.250.0080.00028.09
8.1.240.0060.00323.11
8.1.230.0080.00318.20
8.1.220.0050.00318.16
8.1.210.0060.00318.77
8.1.200.0060.00317.98
8.1.190.0030.00517.73
8.1.180.0050.00318.10
8.1.170.0060.00318.96
8.1.160.0040.00421.18
8.1.150.0050.00219.33
8.1.140.0040.00420.04
8.1.130.0040.00418.18
8.1.120.0080.00018.10
8.1.110.0000.00717.99
8.1.100.0000.00818.11
8.1.90.0040.00417.87
8.1.80.0040.00417.88
8.1.70.0000.00718.13
8.1.60.0040.00418.18
8.1.50.0040.00418.11
8.1.40.0060.00618.14
8.1.30.0080.00018.13
8.1.20.0080.00018.01
8.1.10.0000.00818.09
8.1.00.0040.00418.13
8.0.300.0060.00318.77
8.0.290.0000.00817.38
8.0.280.0040.00418.84
8.0.270.0000.00717.78
8.0.260.0000.00617.65
8.0.250.0040.00417.61
8.0.240.0030.00617.62
8.0.230.0050.00217.63
8.0.220.0040.00417.42
8.0.210.0070.00017.51
8.0.200.0030.00317.54
8.0.190.0040.00417.63
8.0.180.0040.00417.42
8.0.170.0090.00017.54
8.0.160.0040.00417.54
8.0.150.0040.00417.23
8.0.140.0040.00817.50
8.0.130.0000.00613.84
8.0.120.0030.00617.48
8.0.110.0000.00717.47
8.0.100.0050.00317.49
8.0.90.0030.00517.50
8.0.80.0090.00617.27
8.0.70.0040.00417.40
8.0.60.0000.00717.54
8.0.50.0030.00517.47
8.0.30.0080.00917.36
8.0.20.0080.01217.52
8.0.10.0000.00717.62
8.0.00.0100.00917.26
7.4.330.0000.00517.40
7.4.320.0030.00317.04
7.4.300.0000.00717.09
7.4.290.0070.00017.19
7.4.280.0000.00717.20
7.4.270.0080.00017.18
7.4.260.0080.00316.94
7.4.250.0080.00017.17
7.4.240.0050.00216.92
7.4.230.0040.00417.17
7.4.220.0120.01516.95
7.4.210.0060.00917.03
7.4.200.0030.00316.92
7.4.160.0090.00616.89
7.4.150.0070.01017.40
7.4.140.0120.01017.86
7.4.130.0070.01116.78
7.4.120.0080.01017.07
7.4.110.0090.01617.02
7.4.100.0150.00716.82
7.4.90.0070.01017.04
7.4.80.0080.01619.39
7.4.70.0060.01216.83
7.4.60.0100.00716.82
7.4.50.0060.00616.76
7.4.40.0060.01416.89
7.4.30.0100.00716.83
7.4.00.0120.00615.59
7.3.330.0000.00613.80
7.3.320.0060.00013.89
7.3.310.0040.00416.91
7.3.300.0000.00717.03
7.3.290.0110.00516.72
7.3.280.0110.00616.74
7.3.270.0060.01117.40
7.3.260.0090.00916.90
7.3.250.0100.00916.81
7.3.240.0080.01116.86
7.3.230.0120.00616.79
7.3.210.0150.00316.82
7.3.200.0100.00717.11
7.3.190.0100.00616.84
7.3.180.0110.00617.00
7.3.170.0180.00716.88
7.3.160.0150.00616.83
7.2.330.0040.01416.93
7.2.320.0140.00916.97
7.2.310.0040.01817.13
7.2.300.0100.00717.06
7.2.290.0080.00817.17
7.2.110.0130.00717.27
7.2.60.0030.01017.66
7.2.00.0080.00619.88
7.1.200.0040.00716.29
7.1.100.0030.00918.29
7.1.70.0030.00717.82
7.1.60.0070.01119.27
7.1.50.0100.01317.65
7.1.00.0070.07322.77
7.0.200.0480.00315.25
7.0.60.0030.07322.09
7.0.50.0200.06718.16
7.0.40.0070.09020.48
7.0.30.0200.04020.50
7.0.20.0270.08320.31
7.0.10.0070.08720.49
7.0.00.0100.06320.36
5.6.280.0070.06321.18
5.6.210.0300.03320.92
5.6.200.0170.07718.43
5.6.190.0070.08020.73
5.6.180.0300.06320.73
5.6.170.0200.06720.71
5.6.160.0000.04320.87
5.6.150.0000.05718.47
5.6.140.0030.05718.45
5.6.130.0100.08018.42
5.6.120.0000.05721.28
5.6.110.0000.04321.35
5.6.100.0000.07021.27
5.6.90.0130.07721.33
5.6.80.0070.06720.69
5.5.350.4270.03720.81
5.5.340.0070.08018.17
5.5.330.0130.07020.39
5.5.320.0170.05020.48
5.5.310.0230.04320.51
5.5.300.0000.05318.31
5.5.290.0030.04018.23
5.5.280.0070.07321.16
5.5.270.0070.08721.05
5.5.260.0100.04321.15
5.5.250.0130.06020.84
5.5.240.0070.08020.66

preferences:
43.21 ms | 400 KiB | 5 Q