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; } 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'; ?>

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.0080.00818.66
8.3.50.0140.00018.76
8.3.40.0160.00319.43
8.3.30.0100.00319.17
8.3.20.0040.00420.74
8.3.10.0060.00321.02
8.3.00.0040.00421.27
8.2.180.0040.01118.78
8.2.170.0070.00722.96
8.2.160.0070.01022.82
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0040.00421.57
8.2.120.0050.00226.35
8.2.110.0060.00321.37
8.2.100.0070.00418.30
8.2.90.0000.00819.81
8.2.80.0030.00518.13
8.2.70.0030.00618.25
8.2.60.0000.00818.41
8.2.50.0000.00818.25
8.2.40.0030.00520.91
8.2.30.0030.00519.84
8.2.20.0040.00418.43
8.2.10.0040.00418.64
8.2.00.0040.00418.51
8.1.280.0110.00425.92
8.1.270.0060.00324.14
8.1.260.0040.00428.09
8.1.250.0000.00728.09
8.1.240.0060.00322.42
8.1.230.0000.01218.14
8.1.220.0050.00318.41
8.1.210.0050.00318.77
8.1.200.0060.00318.10
8.1.190.0000.01017.85
8.1.180.0080.00018.10
8.1.170.0060.00619.15
8.1.160.0040.00421.08
8.1.150.0000.00821.03
8.1.140.0080.00017.94
8.1.130.0050.00218.12
8.1.120.0000.00818.09
8.1.110.0040.00418.04
8.1.100.0030.00518.03
8.1.90.0050.00218.05
8.1.80.0040.00418.04
8.1.70.0000.00718.12
8.1.60.0030.00618.02
8.1.50.0040.00417.93
8.1.40.0080.00418.10
8.1.30.0090.00018.20
8.1.20.0030.00517.89
8.1.10.0040.00418.06
8.1.00.0040.00417.93
8.0.300.0000.00718.77
8.0.290.0040.00417.50
8.0.280.0030.00519.00
8.0.270.0030.00317.45
8.0.260.0000.00617.70
8.0.250.0030.00417.65
8.0.240.0030.00317.49
8.0.230.0000.00717.62
8.0.220.0030.00317.46
8.0.210.0040.00417.52
8.0.200.0040.00417.63
8.0.190.0070.00017.47
8.0.180.0000.00817.45
8.0.170.0040.00417.52
8.0.160.0030.00317.56
8.0.150.0050.00217.27
8.0.140.0040.00417.46
8.0.130.0050.00013.78
8.0.120.0030.00517.48
8.0.110.0000.00817.34
8.0.100.0040.00417.32
8.0.90.0070.00017.36
8.0.80.0070.00717.21
8.0.70.0040.00417.32
8.0.60.0040.00417.38
8.0.50.0000.00817.57
8.0.30.0100.00717.45
8.0.20.0130.01117.63
8.0.10.0030.00317.77
8.0.00.0090.00917.23
7.4.330.0000.00517.17
7.4.320.0070.00016.98
7.4.300.0030.00316.94
7.4.290.0030.00317.14
7.4.280.0040.00417.09
7.4.270.0030.00316.98
7.4.260.0030.00617.10
7.4.250.0050.00317.19
7.4.240.0040.00416.94
7.4.230.0040.00417.06
7.4.220.0090.01116.97
7.4.210.0060.00916.92
7.4.200.0040.00417.33
7.4.160.0100.00616.84
7.4.150.0070.01017.40
7.4.140.0130.00717.86
7.4.130.0070.01117.05
7.4.120.0090.00916.92
7.4.110.0150.00916.98
7.4.100.0090.00916.71
7.4.90.0170.00016.93
7.4.80.0190.00619.39
7.4.70.0080.00817.04
7.4.60.0100.00616.75
7.4.50.0070.01116.93
7.4.40.0100.00717.11
7.4.30.0040.01216.79
7.4.00.0080.00815.71
7.3.330.0050.00013.92
7.3.320.0050.00013.79
7.3.310.0070.00016.96
7.3.300.0070.00016.82
7.3.290.0090.00616.75
7.3.280.0070.01016.73
7.3.270.0160.00317.40
7.3.260.0100.00717.05
7.3.240.0090.00816.86
7.3.230.0170.00616.83
7.3.210.0060.01216.99
7.3.200.0140.00817.06
7.3.190.0030.01317.01
7.3.180.0100.00716.89
7.3.170.0030.01616.80
7.3.160.0090.00617.02
7.3.120.0060.00915.68
7.3.110.0100.00615.46
7.3.100.0060.00915.13
7.3.90.0120.00615.57
7.3.80.0070.00715.70
7.3.70.0100.00715.64
7.3.60.0100.00315.27
7.3.50.0070.00315.56
7.3.40.0000.01315.61
7.3.30.0060.00615.54
7.3.20.0040.00817.32
7.3.10.0100.00317.39
7.3.00.0120.00316.96
7.2.330.0120.00617.20
7.2.320.0080.01117.28
7.2.310.0060.01016.88
7.2.300.0090.00916.95
7.2.290.0120.00417.25
7.2.250.0070.01415.67
7.2.240.0090.01215.89
7.2.230.0040.01115.48
7.2.220.0030.00715.35
7.2.210.0070.00715.28
7.2.200.0100.00315.76
7.2.190.0070.00415.42
7.2.180.0080.00315.71
7.2.170.0030.01315.34
7.2.60.0100.00717.55
7.2.00.0030.00620.21
7.1.330.0070.01016.52
7.1.320.0060.00616.49
7.1.310.0040.01116.04
7.1.300.0060.00316.61
7.1.290.0040.00716.63
7.1.280.0030.00516.36
7.1.270.0050.00516.51
7.1.260.0100.00316.27
7.1.200.0030.00916.00
7.1.100.0080.00018.59
7.1.70.0060.00317.78
7.1.60.0150.00919.27
7.1.50.0000.02217.31
7.1.00.0030.07722.64
7.0.200.0880.00315.15
7.0.60.0000.05722.12
7.0.50.0000.04718.10
7.0.40.0100.05720.37
7.0.30.0270.08320.38
7.0.20.0230.08720.32
7.0.10.0000.05020.41
7.0.00.0070.07720.35
5.6.280.0070.06021.11
5.6.210.0130.04720.91
5.6.200.0030.05718.47
5.6.190.0070.08320.81
5.6.180.0270.04020.93
5.6.170.0370.07320.72
5.6.160.0000.05720.87
5.6.150.0030.05018.43
5.6.140.0000.08318.49
5.6.130.0070.08018.54
5.6.120.0000.05021.34
5.6.110.0000.06721.29
5.6.100.0130.06721.27
5.6.90.0100.05321.39
5.6.80.0100.07020.77
5.5.350.3500.04020.79
5.5.340.0130.06718.26
5.5.330.0070.07720.46
5.5.320.0230.06020.53
5.5.310.0230.07720.55
5.5.300.0030.08318.23
5.5.290.0030.09018.20
5.5.280.0030.05720.98
5.5.270.0100.06721.00
5.5.260.0100.03721.27
5.5.250.0100.07720.85
5.5.240.0070.03320.55

preferences:
112.72 ms | 400 KiB | 5 Q