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.6734156326455); ?>

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.0100.01018.70
8.3.50.0300.00922.35
8.3.40.0040.01119.11
8.3.30.0040.01119.20
8.3.20.0040.00420.70
8.3.10.0000.00821.03
8.3.00.0040.00421.07
8.2.180.0180.00317.00
8.2.170.0150.00322.96
8.2.160.0030.01222.60
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0050.00221.42
8.2.120.0040.00426.35
8.2.110.0060.00321.30
8.2.100.0130.00018.30
8.2.90.0000.00919.59
8.2.80.0030.00518.13
8.2.70.0030.00617.99
8.2.60.0040.00418.40
8.2.50.0000.00818.25
8.2.40.0030.00520.96
8.2.30.0000.00919.85
8.2.20.0040.00418.30
8.2.10.0040.00418.56
8.2.00.0000.00818.69
8.1.280.0120.00625.92
8.1.270.0100.00624.21
8.1.260.0080.00028.09
8.1.250.0030.00628.09
8.1.240.0060.00322.84
8.1.230.0110.00018.20
8.1.220.0040.00418.26
8.1.210.0000.00918.77
8.1.200.0000.00817.86
8.1.190.0090.00017.97
8.1.180.0030.00618.10
8.1.170.0000.00919.23
8.1.160.0000.00721.16
8.1.150.0000.00821.13
8.1.140.0030.00620.16
8.1.130.0000.00818.05
8.1.120.0040.00418.02
8.1.110.0000.00718.05
8.1.100.0000.00718.04
8.1.90.0050.00318.05
8.1.80.0030.00518.02
8.1.70.0060.00318.12
8.1.60.0040.00418.14
8.1.50.0050.00317.98
8.1.40.0100.00018.09
8.1.30.0080.00018.15
8.1.20.0060.00317.98
8.1.10.0000.00818.02
8.1.00.0000.00817.95
8.0.300.0000.00818.77
8.0.290.0000.00717.25
8.0.280.0030.00318.89
8.0.270.0040.00417.77
8.0.260.0040.00417.79
8.0.250.0000.00717.64
8.0.240.0080.00017.57
8.0.230.0000.00717.57
8.0.220.0070.00017.46
8.0.210.0050.00217.47
8.0.200.0000.00817.55
8.0.190.0040.00417.47
8.0.180.0000.00717.39
8.0.170.0070.00017.37
8.0.160.0000.00717.53
8.0.150.0040.00417.43
8.0.140.0030.00317.42
8.0.130.0000.00513.85
8.0.120.0090.00017.30
8.0.110.0000.00817.36
8.0.100.0000.00717.63
8.0.90.0050.00217.36
8.0.80.0000.01517.30
8.0.70.0070.00017.43
8.0.60.0080.00017.30
8.0.50.0050.00317.56
8.0.30.0070.01217.61
8.0.20.0060.01317.50
8.0.10.0040.00417.61
8.0.00.0080.00917.16
7.4.330.0050.00017.27
7.4.320.0030.00317.18
7.4.300.0030.00317.15
7.4.290.0030.00317.00
7.4.280.0050.00317.20
7.4.270.0070.00017.14
7.4.260.0060.00317.05
7.4.250.0000.00817.14
7.4.240.0070.00017.17
7.4.230.0050.00316.97
7.4.220.0100.01017.05
7.4.210.0160.00416.98
7.4.200.0030.00317.07
7.4.160.0070.00716.88
7.4.150.0110.00717.40
7.4.140.0120.00817.86
7.4.130.0110.00616.92
7.4.120.0070.01017.00
7.4.110.0110.01417.05
7.4.100.0030.02216.95
7.4.90.0150.00317.15
7.4.80.0110.01119.39
7.4.70.0030.01316.98
7.4.60.0040.01217.02
7.4.50.0130.00316.79
7.4.40.0110.00616.98
7.4.30.0090.00916.80
7.4.00.0030.01015.59
7.3.330.0020.00213.79
7.3.320.0050.00013.72
7.3.310.0030.00316.79
7.3.300.0000.00716.91
7.3.290.0110.00916.78
7.3.280.0090.00916.80
7.3.270.0080.00817.40
7.3.260.0090.00917.05
7.3.250.0100.01016.82
7.3.240.0140.00416.99
7.3.230.0060.01216.96
7.3.210.0090.00916.88
7.3.200.0130.00316.97
7.3.190.0030.01416.96
7.3.180.0000.01516.98
7.3.170.0090.01216.90
7.3.160.0090.01317.05
7.3.120.0030.01015.71
7.3.110.0070.01015.37
7.3.100.0080.00615.65
7.3.90.0030.00915.41
7.3.80.0070.00715.73
7.3.70.0040.00815.52
7.3.60.0080.00415.57
7.3.50.0030.01015.50
7.3.40.0120.00315.18
7.3.30.0040.01115.59
7.3.20.0070.00417.02
7.3.10.0090.00417.27
7.3.00.0060.01017.24
7.2.330.0110.01117.28
7.2.320.0060.01217.01
7.2.310.0100.00617.04
7.2.300.0100.00717.11
7.2.290.0030.01316.96
7.2.240.0050.00515.54
7.2.230.0100.00715.29
7.2.220.0060.01215.82
7.2.210.0110.00315.55
7.2.200.0000.01615.31
7.2.190.0100.00615.63
7.2.180.0040.00815.67
7.2.170.0070.00715.23
7.2.160.0060.00615.57
7.2.150.0070.00417.19
7.2.140.0030.00917.33
7.2.130.0070.00717.38
7.2.120.0030.00817.55
7.2.110.0070.00817.27
7.2.100.0050.00917.31
7.2.90.0060.01017.34
7.2.80.0060.00917.51
7.2.70.0080.00517.40
7.2.60.0030.01117.44
7.2.50.0040.00917.42
7.2.40.0060.00717.43
7.2.30.0030.00917.32
7.2.20.0060.00917.40
7.2.10.0030.01017.41
7.2.00.0050.00918.17
7.1.330.0080.00516.21
7.1.320.0070.00316.06
7.1.310.0060.01016.29
7.1.300.0000.01416.14
7.1.290.0040.01116.12
7.1.280.0000.00816.04
7.1.270.0060.00916.29
7.1.260.0090.00616.23
7.1.250.0090.00316.31
7.1.200.0000.00716.42
7.1.100.0040.01118.86
7.1.70.0070.00017.78
7.1.60.0070.01319.27
7.1.50.0040.01817.52
7.1.00.0030.07722.63
7.0.200.0280.00314.84
7.0.60.0130.05721.97
7.0.50.0070.08018.19
7.0.40.0230.07320.42
7.0.30.0330.09020.36
7.0.20.0430.07020.43
7.0.10.0030.04320.43
7.0.00.0070.08020.48
5.6.280.0000.03321.38
5.6.210.0100.08320.82
5.6.200.0070.05318.41
5.6.190.0100.08720.65
5.6.180.0200.07320.82
5.6.170.0300.08020.70
5.6.160.0070.06020.88
5.6.150.0170.06018.42
5.6.140.0170.07318.39
5.6.130.0030.05718.41
5.6.120.0130.07721.34
5.6.110.0030.08721.30
5.6.100.0170.07321.27
5.6.90.0130.05321.39
5.6.80.0130.07320.75
5.5.350.4200.04320.66
5.5.340.0130.07318.21
5.5.330.0070.08020.52
5.5.320.0330.07720.73
5.5.310.0270.08020.57
5.5.300.0070.07318.39
5.5.290.0170.08018.24
5.5.280.0130.08021.13
5.5.270.0130.07321.05
5.5.260.0130.03321.05
5.5.250.0070.06720.98
5.5.240.0070.03320.55

preferences:
70.35 ms | 401 KiB | 5 Q