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($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.60.0190.00318.93
8.3.50.0150.00922.11
8.3.40.0120.00319.37
8.3.30.0120.00319.48
8.3.20.0070.00020.71
8.3.10.0050.00321.11
8.3.00.0080.00021.02
8.2.180.0070.01117.13
8.2.170.0140.00722.96
8.2.160.0030.01022.57
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0080.00021.32
8.2.120.0000.00826.35
8.2.110.0060.00321.41
8.2.100.0120.00018.28
8.2.90.0080.00018.40
8.2.80.0050.00218.53
8.2.70.0040.00418.13
8.2.60.0070.00418.43
8.2.50.0050.00318.13
8.2.40.0030.00621.05
8.2.30.0030.00619.79
8.2.20.0040.00418.32
8.2.10.0040.00418.68
8.2.00.0080.00018.61
8.1.280.0120.00325.92
8.1.270.0120.00324.16
8.1.260.0080.00028.09
8.1.250.0040.00428.09
8.1.240.0060.00324.25
8.1.230.0040.00821.22
8.1.220.0040.00418.29
8.1.210.0000.00819.53
8.1.200.0040.00417.96
8.1.190.0050.00517.98
8.1.180.0080.00018.10
8.1.170.0030.00618.96
8.1.160.0040.00421.19
8.1.150.0000.00719.38
8.1.140.0000.00819.94
8.1.130.0000.00718.20
8.1.120.0000.00718.03
8.1.110.0040.00417.91
8.1.100.0040.00418.05
8.1.90.0030.00518.05
8.1.80.0000.00717.97
8.1.70.0020.00518.08
8.1.60.0080.00018.20
8.1.50.0060.00317.98
8.1.40.0100.00318.09
8.1.30.0040.00418.31
8.1.20.0040.00418.07
8.1.10.0000.00818.07
8.1.00.0000.00718.14
8.0.300.0000.00720.39
8.0.290.0090.00017.25
8.0.280.0050.00219.11
8.0.270.0040.00417.91
8.0.260.0000.00817.89
8.0.250.0030.00317.62
8.0.240.0040.00417.50
8.0.230.0050.00317.47
8.0.220.0050.00317.57
8.0.210.0040.00417.56
8.0.200.0030.00317.56
8.0.190.0070.00017.61
8.0.180.0020.00517.48
8.0.170.0000.00817.51
8.0.160.0050.00217.58
8.0.150.0000.00717.40
8.0.140.0040.00417.42
8.0.130.0050.00013.86
8.0.120.0030.00617.45
8.0.110.0040.00417.42
8.0.100.0040.00417.46
8.0.90.0040.00417.41
8.0.80.0040.01117.38
8.0.70.0030.00517.44
8.0.60.0070.00017.34
8.0.50.0050.00317.50
8.0.30.0080.01017.62
8.0.20.0090.01317.50
8.0.10.0040.00317.74
8.0.00.0080.00917.14
7.4.330.0050.00017.26
7.4.320.0000.00717.20
7.4.300.0050.00317.01
7.4.290.0000.00717.16
7.4.280.0030.00417.13
7.4.270.0030.00317.05
7.4.260.0040.00417.21
7.4.250.0080.00017.05
7.4.240.0000.00717.16
7.4.230.0030.00317.15
7.4.220.0060.01217.01
7.4.210.0040.01116.95
7.4.200.0000.00716.91
7.4.160.0160.00017.19
7.4.150.0150.00317.40
7.4.140.0130.00617.86
7.4.130.0110.00816.91
7.4.120.0130.00816.90
7.4.110.0130.01016.77
7.4.100.0200.00316.98
7.4.90.0070.01016.80
7.4.80.0080.01119.39
7.4.70.0060.01016.92
7.4.60.0100.00716.97
7.4.50.0000.01417.41
7.4.40.0060.01217.11
7.4.30.0070.01017.08
7.4.00.0070.01015.41
7.3.330.0000.00613.93
7.3.320.0000.00613.92
7.3.310.0030.00316.75
7.3.300.0070.00016.98
7.3.290.0090.00816.74
7.3.280.0080.01016.81
7.3.270.0030.01517.40
7.3.260.0100.01416.93
7.3.250.0120.00916.91
7.3.240.0060.01116.94
7.3.230.0070.01016.98
7.3.210.0140.00416.98
7.3.200.0100.00716.92
7.3.190.0150.00816.81
7.3.180.0100.00717.00
7.3.170.0090.00917.02
7.3.160.0150.00316.91
7.2.330.0080.00917.23
7.2.320.0080.01116.98
7.2.310.0060.01517.05
7.2.300.0070.01117.12
7.2.290.0130.00917.20
7.2.60.0040.01117.49
7.2.50.0040.00717.42
7.2.00.0040.00819.86
7.1.200.0060.00916.63
7.1.100.0040.01118.38
7.1.70.0000.00817.83
7.1.60.0060.00619.27
7.1.50.0000.02117.77
7.1.00.0070.07322.57
7.0.200.0500.00315.44
7.0.60.0030.08322.10
7.0.50.0130.07318.10
7.0.40.0030.04720.46
7.0.30.0270.03720.38
7.0.20.0470.06720.31
7.0.10.0070.05020.45
7.0.00.0170.07320.45
5.6.280.0000.05721.35
5.6.210.0030.07320.92
5.6.200.0100.04018.42
5.6.190.0200.07321.04
5.6.180.0430.07020.77
5.6.170.0300.05020.76
5.6.160.0070.06020.75
5.6.150.0130.07718.47
5.6.140.0170.06718.48
5.6.130.0070.04018.44
5.6.120.0070.07721.34
5.6.110.0100.03721.38
5.6.100.0300.05721.38
5.6.90.0130.08021.39
5.6.80.0170.08020.73
5.5.350.4170.04320.67
5.5.340.0070.05018.23
5.5.330.0000.05320.82
5.5.320.0530.06720.49
5.5.310.0330.07020.70
5.5.300.0070.08018.20
5.5.290.0000.08718.28
5.5.280.0130.04321.18
5.5.270.0170.07321.27
5.5.260.0070.08021.16
5.5.250.0130.07720.94
5.5.240.0070.03720.48

preferences:
45.89 ms | 401 KiB | 5 Q