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){ $salida = $Distancia / $Tiempo; return $salida / 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; echo '\n'; echo round(7.6734156326455E-5); ?>

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.60.0170.00319.06
8.3.50.0100.01022.30
8.3.40.0090.00619.54
8.3.30.0040.01119.14
8.3.20.0040.00421.01
8.3.10.0000.00821.15
8.3.00.0080.00021.14
8.2.180.0070.01116.72
8.2.170.0120.00622.96
8.2.160.0090.00622.39
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0040.00421.65
8.2.120.0080.00026.35
8.2.110.0060.00321.27
8.2.100.0000.01218.47
8.2.90.0000.00818.41
8.2.80.0070.00018.72
8.2.70.0030.00718.13
8.2.60.0000.01018.43
8.2.50.0030.00618.38
8.2.40.0000.00820.80
8.2.30.0060.00319.80
8.2.20.0000.00818.20
8.2.10.0040.00418.52
8.2.00.0070.00018.64
8.1.280.0060.00825.92
8.1.270.0000.01524.25
8.1.260.0060.00328.09
8.1.250.0050.00328.09
8.1.240.0080.00024.48
8.1.230.0000.01221.32
8.1.220.0040.00418.16
8.1.210.0040.00419.28
8.1.200.0000.00917.75
8.1.190.0040.00417.85
8.1.180.0040.00418.10
8.1.170.0110.00019.25
8.1.160.0000.00821.14
8.1.150.0040.00421.10
8.1.140.0090.00019.95
8.1.130.0030.00318.06
8.1.120.0040.00418.08
8.1.110.0000.00718.01
8.1.100.0070.00018.04
8.1.90.0000.00817.96
8.1.80.0050.00317.92
8.1.70.0000.00718.10
8.1.60.0080.00018.13
8.1.50.0040.00418.08
8.1.40.0040.00818.09
8.1.30.0000.00818.18
8.1.20.0000.00817.95
8.1.10.0050.00217.96
8.1.00.0040.00418.10
8.0.300.0040.00420.62
8.0.290.0000.00717.38
8.0.280.0040.00418.97
8.0.270.0000.00717.73
8.0.260.0080.00017.63
8.0.250.0000.00717.50
8.0.240.0070.00017.48
8.0.230.0080.00017.59
8.0.220.0000.00717.55
8.0.210.0040.00417.55
8.0.200.0000.00617.59
8.0.190.0000.00717.63
8.0.180.0040.00417.53
8.0.170.0040.00417.39
8.0.160.0070.00017.43
8.0.150.0030.00617.44
8.0.140.0000.00717.47
8.0.130.0030.00313.89
8.0.120.0030.00617.46
8.0.110.0030.00517.42
8.0.100.0040.00417.32
8.0.90.0090.00017.55
8.0.80.0090.00617.33
8.0.70.0000.00717.57
8.0.60.0050.00217.55
8.0.50.0000.00817.46
8.0.30.0110.00817.51
8.0.20.0090.01117.56
8.0.10.0030.00517.37
8.0.00.0080.01017.38
7.4.330.0060.00017.13
7.4.320.0030.00317.10
7.4.300.0050.00217.15
7.4.290.0080.00017.07
7.4.280.0050.00317.16
7.4.270.0030.00317.07
7.4.260.0050.00316.97
7.4.250.0060.00317.03
7.4.240.0070.00017.24
7.4.230.0030.00317.32
7.4.220.0110.00816.92
7.4.210.0110.00417.00
7.4.200.0000.00717.29
7.4.160.0090.00616.93
7.4.150.0070.01017.40
7.4.140.0060.01217.86
7.4.130.0050.01316.96
7.4.120.0060.01217.04
7.4.110.0150.01016.99
7.4.100.0040.01817.02
7.4.90.0080.00817.00
7.4.80.0090.00919.39
7.4.70.0130.00316.99
7.4.60.0100.00716.91
7.4.50.0090.00617.12
7.4.40.0070.01017.20
7.4.30.0110.00616.77
7.4.00.0060.00915.36
7.3.330.0050.00013.94
7.3.320.0000.00613.90
7.3.310.0030.00316.95
7.3.300.0070.00016.92
7.3.290.0140.00216.75
7.3.280.0110.00916.76
7.3.270.0140.00317.40
7.3.260.0100.00716.73
7.3.250.0120.00716.83
7.3.240.0130.00716.87
7.3.230.0060.00916.96
7.3.210.0150.00316.88
7.3.200.0040.01416.94
7.3.190.0100.00916.76
7.3.180.0100.00616.78
7.3.170.0060.01517.05
7.3.160.0090.01216.83
7.3.10.0100.00717.06
7.3.00.0090.00616.92
7.2.330.0110.00817.21
7.2.320.0140.00616.91
7.2.310.0130.00716.92
7.2.300.0030.01417.26
7.2.290.0110.00717.21
7.2.130.0040.01517.03
7.2.120.0090.00617.25
7.2.110.0070.01017.50
7.2.100.0100.00317.53
7.2.90.0000.01717.26
7.2.80.0090.00317.29
7.2.70.0000.01517.51
7.2.60.0110.00317.31
7.2.50.0060.00317.08
7.2.40.0030.01116.85
7.2.30.0030.01617.11
7.2.20.0060.00617.39
7.2.10.0070.00717.28
7.2.00.0070.00518.46
7.1.250.0050.01016.04
7.1.200.0000.01216.35
7.1.100.0070.00718.32
7.1.70.0070.00317.83
7.1.60.0040.00719.27
7.1.50.0040.01817.27
7.1.00.0030.07722.62
7.0.200.0320.00415.30
7.0.60.0000.04721.99
7.0.50.0070.06318.15
7.0.40.0100.04320.43
7.0.30.0170.05720.31
7.0.20.0470.06720.49
7.0.10.0070.04720.55
7.0.00.0100.06720.45
5.6.280.0030.03021.21
5.6.210.0030.05020.91
5.6.200.0100.07718.55
5.6.190.0130.07720.82
5.6.180.0370.07320.73
5.6.170.0330.08020.79
5.6.160.0030.05320.79
5.6.150.0030.06718.47
5.6.140.0100.07018.51
5.6.130.0030.07718.51
5.6.120.0070.05021.41
5.6.110.0000.04721.30
5.6.100.0070.08321.42
5.6.90.0130.08021.39
5.6.80.0100.07720.82
5.5.350.3700.03720.74
5.5.340.0030.08018.20
5.5.330.0070.08320.65
5.5.320.0130.04720.59
5.5.310.0270.07020.52
5.5.300.0230.06018.34
5.5.290.0130.03318.21
5.5.280.0030.06021.06
5.5.270.0100.08721.11
5.5.260.0100.07321.01
5.5.250.0030.09020.82
5.5.240.0100.07320.52

preferences:
57.73 ms | 401 KiB | 5 Q