3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Fecha = "2016-01-27 11:34:19"; function CalcularTiempo($Timestamp){ $Segundos = strtotime('now') - strtotime($Timestamp); return intval($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 $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.0120.00619.41
8.3.30.0040.01119.26
8.3.20.0000.00820.71
8.3.10.0040.00420.97
8.3.00.0050.00321.14
8.2.170.0040.01122.96
8.2.160.0040.01122.30
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0100.00021.45
8.2.120.0040.00426.35
8.2.110.0070.00321.34
8.2.100.0110.00018.05
8.2.90.0000.00919.57
8.2.80.0040.00418.13
8.2.70.0000.00918.13
8.2.60.0080.00018.54
8.2.50.0030.00619.86
8.2.40.0000.00820.89
8.2.30.0040.00719.86
8.2.20.0000.00818.45
8.2.10.0000.00718.63
8.2.00.0040.00418.73
8.1.270.0090.00924.47
8.1.260.0030.00628.09
8.1.250.0020.00528.09
8.1.240.0080.00022.81
8.1.230.0090.00318.33
8.1.220.0040.00418.15
8.1.210.0040.00418.77
8.1.200.0030.00617.98
8.1.190.0000.00917.85
8.1.180.0000.00818.10
8.1.170.0050.00318.99
8.1.160.0050.00221.17
8.1.150.0000.00819.39
8.1.140.0040.00419.95
8.1.130.0000.00718.23
8.1.120.0050.00218.11
8.1.110.0000.00717.88
8.1.100.0000.00818.03
8.1.90.0000.00717.92
8.1.80.0000.00818.08
8.1.70.0030.00318.02
8.1.60.0050.00318.18
8.1.50.0040.00418.05
8.1.40.0060.00317.96
8.1.30.0050.00318.27
8.1.20.0040.00418.05
8.1.10.0060.00318.09
8.1.00.0030.00618.14
8.0.300.0060.00318.77
8.0.290.0040.00417.38
8.0.280.0070.00018.88
8.0.270.0050.00317.82
8.0.260.0030.00317.68
8.0.250.0030.00317.53
8.0.240.0080.00017.61
8.0.230.0030.00317.51
8.0.220.0000.00817.41
8.0.210.0000.00717.33
8.0.200.0060.00017.59
8.0.190.0080.00017.60
8.0.180.0080.00017.48
8.0.170.0030.00717.57
8.0.160.0050.00217.48
8.0.150.0080.00017.49
8.0.140.0050.00217.48
8.0.130.0030.00313.89
8.0.120.0050.00517.29
8.0.110.0070.00017.37
8.0.100.0070.00017.38
8.0.90.0070.00017.34
8.0.80.0060.00917.25
8.0.70.0050.00217.46
8.0.60.0040.00417.48
8.0.50.0020.00517.54
8.0.30.0060.01217.38
8.0.20.0120.00617.54
8.0.10.0050.00217.46
8.0.00.0130.00617.24
7.4.330.0000.00517.30
7.4.320.0030.00317.18
7.4.300.0000.00616.99
7.4.290.0040.00417.16
7.4.280.0040.00417.18
7.4.270.0000.00717.06
7.4.260.0030.00617.20
7.4.250.0000.00717.05
7.4.240.0080.00017.19
7.4.230.0070.00016.98
7.4.220.0060.01217.00
7.4.210.0150.00617.08
7.4.200.0040.00416.98
7.4.160.0120.00916.89
7.4.150.0150.00317.40
7.4.140.0100.00817.86
7.4.130.0110.00916.83
7.4.120.0160.00216.87
7.4.110.0140.00316.84
7.4.100.0070.01116.75
7.4.90.0070.01016.91
7.4.80.0150.00419.39
7.4.70.0050.01116.96
7.4.60.0130.00416.83
7.4.50.0030.01316.85
7.4.40.0090.00917.07
7.4.30.0150.00317.03
7.4.00.0070.01015.54
7.3.330.0040.00213.79
7.3.320.0070.00013.86
7.3.310.0040.00416.78
7.3.300.0030.00316.80
7.3.290.0090.00916.75
7.3.280.0100.00916.67
7.3.270.0110.00717.40
7.3.260.0090.00816.92
7.3.250.0100.00716.80
7.3.240.0100.00716.94
7.3.230.0120.00916.61
7.3.210.0170.00316.85
7.3.200.0100.00616.73
7.3.190.0110.00516.81
7.3.180.0070.01016.92
7.3.170.0110.00717.08
7.3.160.0120.00316.80
7.3.10.0030.01017.33
7.3.00.0040.01217.36
7.2.330.0100.00717.16
7.2.320.0070.01716.89
7.2.310.0090.00916.73
7.2.300.0030.01316.87
7.2.290.0090.01216.86
7.2.130.0030.00617.75
7.2.120.0080.00817.45
7.2.110.0200.00717.23
7.2.100.0110.00417.15
7.2.90.0110.00417.49
7.2.80.0080.00317.58
7.2.70.0100.00717.16
7.2.60.0030.01317.46
7.2.50.0060.00617.45
7.2.40.0040.01117.59
7.2.30.0030.01017.54
7.2.20.0030.01417.59
7.2.10.0150.00017.61
7.2.00.0060.00918.45
7.1.250.0050.00516.41
7.1.200.0040.01116.15
7.1.100.0030.00618.82
7.1.70.0030.01017.91
7.1.60.0150.01119.27
7.1.50.0040.01817.74
7.1.00.0100.07022.79
7.0.200.0470.00715.50
7.0.60.0030.04722.05
7.0.50.0070.03718.20
7.0.40.0130.05720.51
7.0.30.0300.07320.52
7.0.20.0300.08020.38
7.0.10.0030.04320.38
7.0.00.0030.08720.39
5.6.280.0030.03021.40
5.6.210.0100.07720.90
5.6.200.0070.08718.46
5.6.190.0030.05320.72
5.6.180.0270.04720.82
5.6.170.0330.07720.89
5.6.160.0030.08720.72
5.6.150.0000.08718.43
5.6.140.0070.04718.47
5.6.130.0070.08718.51
5.6.120.0100.08321.36
5.6.110.0070.08721.35
5.6.100.0070.06021.32
5.6.90.0070.08021.39
5.6.80.0100.03720.78
5.5.350.0330.07720.70
5.5.340.0130.07318.23
5.5.330.0030.04020.72
5.5.320.0300.08020.51
5.5.310.0300.07020.56
5.5.300.0100.07718.20
5.5.290.0100.07718.27
5.5.280.0130.08321.16
5.5.270.0030.04721.14
5.5.260.0130.07721.04
5.5.250.0100.08021.07
5.5.240.0030.07720.39

preferences:
47.21 ms | 400 KiB | 5 Q