3v4l.org

run code in 300+ PHP versions simultaneously
<?php $townsJson = <<<JSON [{"id":"AA0","name":"Aalen","region":"Süden","state":"Baden-Württemberg"}, {"id":"AB0","name":"Aschaffenburg","region":"Mitte","state":"Bayern"}, {"id":"AC0","name":"Aachen","region":"Westen","state":"Nordrhein-Westfalen"}, {"id":"WIT","name":"Witten","region":"Westen","state":"Nordrhein-Westfalen"}, {"id":"DN0","name":"Düren","region":"Westen","state":"Nordrhein-Westfalen"}] JSON; $towns = json_decode($townsJson, true); $towns = array_map(function(array $town) { $town['description'] = sprintf( '%s is a town in %s (%s).', $town['name'], $town['state'], $town['region'] ); return $town; }, $towns); $ATowns = array_filter($towns, fn(array $town) => strpos($town['name'], 'A') === 0); $townsByRegion = array_reduce($towns, function(array $found, array $town) { $found[$town['region']][] = $town; return $found; }, []); var_dump($towns, $ATowns, $townsByRegion);

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.4.140.0140.00817.33
8.4.130.0120.01017.63
8.4.120.0130.00720.46
8.4.110.0150.00622.79
8.4.100.0110.01117.98
8.4.90.0150.00618.90
8.4.80.0110.00918.12
8.4.70.0040.00517.93
8.4.60.0100.01518.91
8.4.50.0050.00420.68
8.4.40.0130.01017.95
8.4.30.0150.00318.66
8.4.20.0140.00722.31
8.4.10.0090.00321.94
8.3.270.0100.01116.73
8.3.260.0130.00616.37
8.3.250.0110.00918.98
8.3.240.0110.00816.57
8.3.230.0060.00516.78
8.3.220.0030.00517.41
8.3.210.0060.00516.68
8.3.200.0140.00516.77
8.3.190.0060.00317.15
8.3.180.0080.00416.73
8.3.170.0040.00417.38
8.3.160.0030.00618.29
8.3.150.0030.00619.07
8.3.140.0090.00017.34
8.3.130.0040.00418.43
8.3.120.0120.00618.80
8.3.110.0030.00620.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0110.00016.63
8.3.70.0130.01016.63
8.3.60.0000.01616.75
8.3.50.0090.00920.15
8.3.40.0110.00420.33
8.3.30.0080.00818.88
8.3.20.0110.00024.18
8.3.10.0050.00324.66
8.3.00.0030.00526.16
8.2.290.0050.00420.29
8.2.280.0150.00518.74
8.2.270.0100.01017.19
8.2.260.0050.00316.83
8.2.250.0090.00016.47
8.2.240.0080.00017.10
8.2.230.0040.00422.58
8.2.220.0140.00337.54
8.2.210.0060.00326.77
8.2.200.0090.00416.38
8.2.190.0120.00316.88
8.2.180.0090.00925.92
8.2.170.0200.00018.80
8.2.160.0110.00322.96
8.2.150.0060.00325.66
8.2.140.0060.00324.66
8.2.130.0030.00526.16
8.2.120.0080.00019.36
8.2.110.0070.00319.27
8.2.100.0070.00717.72
8.2.90.0040.00418.34
8.2.80.0060.00317.97
8.2.70.0000.00817.50
8.2.60.0030.00617.50
8.2.50.0060.00318.05
8.2.40.0000.00818.09
8.2.30.0000.00918.19
8.2.20.0000.00819.38
8.2.10.0050.00318.01
8.2.00.0000.00819.33
8.1.330.0150.00522.09
8.1.320.0060.00216.39
8.1.310.0060.01316.74
8.1.300.0030.00620.29
8.1.290.0100.00330.84
8.1.280.0130.01025.92
8.1.270.0090.00023.79
8.1.260.0090.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00323.90
8.1.230.0070.00722.45
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0040.00417.63
8.1.190.0000.00917.38
8.1.180.0040.00418.10
8.1.170.0040.00417.62
8.1.160.0040.00418.75
8.1.150.0030.00518.68
8.1.140.0040.00417.51
8.1.130.0000.00820.67
8.1.120.0040.00417.44
8.1.110.0130.00417.46
8.1.100.0160.00217.45
8.1.90.0100.00517.41
8.1.80.0110.00417.47
8.1.70.0140.00217.42
8.1.60.0120.00617.64
8.1.50.0160.00317.53
8.1.40.0150.00417.55
8.1.30.0110.00717.56
8.1.20.0090.00917.59
8.1.10.0150.00417.45
8.1.00.0200.00017.50
8.0.300.0080.00020.13
8.0.290.0040.00416.63
8.0.280.0070.00018.44
8.0.270.0000.00717.13
8.0.260.0050.00318.39
8.0.250.0050.00216.96
8.0.240.0120.00616.79
8.0.230.0110.00616.76
8.0.220.0140.00216.74
8.0.210.0160.00016.79
8.0.200.0090.00617.06
8.0.190.0090.00917.06
8.0.180.0110.00616.79
8.0.170.0130.00316.98
8.0.160.0050.01116.89
8.0.150.0110.00516.84
8.0.140.0140.00216.95
8.0.130.0000.01616.84
8.0.120.0050.01416.95
8.0.110.0060.00916.95
8.0.100.0080.00816.78
8.0.90.0080.00816.91
8.0.80.0120.00416.96
8.0.70.0150.00016.73
8.0.60.0070.00716.91
8.0.50.0130.00316.86
8.0.30.0120.00416.77
8.0.20.0140.00316.93
8.0.10.0080.00817.02
7.4.330.0050.00015.55
7.4.320.0130.00316.57
7.4.300.0090.00416.55
7.4.290.0070.00716.60
7.4.280.0100.00816.61
7.4.270.0160.00016.50
7.4.260.0090.00916.50
7.4.250.0120.00616.36
7.4.240.0000.01016.09
7.4.230.0110.00316.54
7.4.220.0090.00616.50
7.4.210.0120.00216.43
7.4.200.0110.00316.59
7.4.190.0080.00816.50
7.4.180.0100.00516.54
7.4.160.0110.00016.21
7.4.150.0070.00416.54
7.4.140.0000.00916.36
7.4.130.0030.00316.37
7.4.120.0000.00716.33
7.4.110.0030.00316.42
7.4.100.0030.00316.43
7.4.90.0070.00016.34
7.4.80.0050.00316.30
7.4.70.0030.00316.45
7.4.60.0000.00716.38
7.4.50.0030.00316.28
7.4.40.0000.00716.22
7.4.30.0030.00316.45
7.4.20.0020.00516.43
7.4.10.0000.00816.29
7.4.00.0060.00316.42

preferences:
30.62 ms | 403 KiB | 5 Q