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.0180.00419.48
8.3.30.0070.00719.16
8.3.20.0000.00820.59
8.3.10.0030.00621.03
8.3.00.0000.00821.05
8.2.170.0070.01022.96
8.2.160.0070.00722.34
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00021.39
8.2.120.0070.00026.35
8.2.110.0090.00019.89
8.2.100.0070.00418.41
8.2.90.0000.00919.59
8.2.80.0050.00318.13
8.2.70.0040.00418.38
8.2.60.0070.00318.41
8.2.50.0000.00818.13
8.2.40.0030.00620.96
8.2.30.0000.00719.92
8.2.20.0080.00018.27
8.2.10.0040.00418.64
8.2.00.0000.00718.73
8.1.270.0040.01124.29
8.1.260.0030.00528.09
8.1.250.0030.00528.09
8.1.240.0030.00722.85
8.1.230.0080.00318.27
8.1.220.0040.00418.25
8.1.210.0050.00318.77
8.1.200.0030.00617.85
8.1.190.0050.00317.85
8.1.180.0040.00418.10
8.1.170.0030.00518.87
8.1.160.0000.00821.26
8.1.150.0040.00419.38
8.1.140.0040.00420.01
8.1.130.0000.00919.81
8.1.120.0040.00418.09
8.1.110.0050.00217.92
8.1.100.0050.00217.93
8.1.90.0040.00417.93
8.1.80.0000.00717.95
8.1.70.0080.00018.10
8.1.60.0040.00418.01
8.1.50.0000.00818.16
8.1.40.0040.00818.03
8.1.30.0000.00818.32
8.1.20.0080.00018.16
8.1.10.0000.00817.98
8.1.00.0000.00817.96
8.0.300.0000.00818.77
8.0.290.0000.00717.25
8.0.280.0000.00718.85
8.0.270.0030.00317.74
8.0.260.0070.00017.45
8.0.250.0070.00017.62
8.0.240.0070.00017.43
8.0.230.0040.00417.52
8.0.220.0000.00717.59
8.0.210.0000.00717.54
8.0.200.0060.00017.62
8.0.190.0040.00417.58
8.0.180.0020.00517.45
8.0.170.0080.00017.50
8.0.160.0070.00017.62
8.0.150.0000.00717.37
8.0.140.0050.00317.28
8.0.130.0000.00613.79
8.0.120.0050.00517.38
8.0.110.0070.00017.54
8.0.100.0040.00417.39
8.0.90.0030.00517.38
8.0.80.0030.01117.29
8.0.70.0000.00817.39
8.0.60.0080.00017.39
8.0.50.0050.00317.47
8.0.30.0110.00617.37
8.0.20.0120.00917.53
8.0.10.0000.00717.53
8.0.00.0110.00617.13
7.4.330.0050.00017.18
7.4.320.0070.00017.08
7.4.300.0070.00017.11
7.4.290.0000.00817.08
7.4.280.0040.00417.20
7.4.270.0000.00817.17
7.4.260.0050.00517.20
7.4.250.0000.00717.11
7.4.240.0000.00717.12
7.4.230.0040.00417.09
7.4.220.0090.00916.96
7.4.210.0110.00416.93
7.4.200.0030.00317.00
7.4.160.0000.01517.00
7.4.150.0080.00917.40
7.4.140.0130.00617.86
7.4.130.0150.00516.81
7.4.120.0120.00816.93
7.4.110.0100.01017.10
7.4.100.0120.00616.96
7.4.90.0040.01316.82
7.4.80.0030.01519.39
7.4.70.0100.00717.14
7.4.60.0070.01016.86
7.4.50.0000.01117.00
7.4.40.0070.01016.84
7.4.30.0130.01017.00
7.4.00.0120.00315.59
7.3.330.0060.00013.80
7.3.320.0060.00013.77
7.3.310.0000.00717.04
7.3.300.0070.00017.00
7.3.290.0060.00916.74
7.3.280.0110.01016.72
7.3.270.0030.01617.40
7.3.260.0060.01217.01
7.3.250.0120.00816.88
7.3.240.0070.01017.01
7.3.230.0100.00816.91
7.3.210.0090.01216.79
7.3.200.0070.01116.86
7.3.190.0100.00716.99
7.3.180.0120.00316.89
7.3.170.0150.00317.00
7.3.160.0060.00917.04
7.2.330.0130.00616.87
7.2.320.0090.01517.06
7.2.310.0160.00017.17
7.2.300.0070.01117.16
7.2.290.0140.00316.93
7.2.110.0210.00717.15
7.2.60.0000.01417.28
7.2.00.0000.01219.78
7.1.200.0030.01316.29
7.1.100.0030.01018.97
7.1.70.0060.00917.77
7.1.60.0070.01819.27
7.1.50.0060.01217.76
7.1.00.0000.08022.77
7.0.200.0660.00314.88
7.0.60.0030.06322.12
7.0.50.0100.07718.20
7.0.40.0130.08320.42
7.0.30.0270.05720.36
7.0.20.0330.07720.31
7.0.10.0070.08320.36
7.0.00.0200.07320.39
5.6.280.0030.05721.41
5.6.210.0070.08721.04
5.6.200.0030.08318.43
5.6.190.0200.07720.77
5.6.180.0270.07320.82
5.6.170.0330.08020.69
5.6.160.0030.06020.79
5.6.150.0000.06718.55
5.6.140.0100.07318.41
5.6.130.0000.04718.41
5.6.120.0100.08021.34
5.6.110.0200.07321.30
5.6.100.0070.07721.34
5.6.90.0070.08321.23
5.6.80.0130.04720.84
5.5.350.3830.04320.64
5.5.340.0070.08718.39
5.5.330.0030.05720.52
5.5.320.0130.04320.49
5.5.310.0300.07320.57
5.5.300.0100.07718.23
5.5.290.0100.06018.29
5.5.280.0130.06321.06
5.5.270.0200.07321.02
5.5.260.0000.04721.02
5.5.250.0130.07720.90
5.5.240.0000.03320.55

preferences:
44.69 ms | 400 KiB | 5 Q