3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = [ 'some', 'test', 'stuff', 1, ]; $filtered = array_filter($items, function ($item) { return is_string($item); }); $capitalized = array_map(function ($item) { return strtoupper($item); }, $filtered); $result = array_reduce($capitalized, function ($carry, $item) { return $carry . $item; }); print_r($result); $result = ''; foreach ($items as $item) { if (is_string($item)) { $result .= strtoupper($item); } } print_r($result);

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.70.0130.00316.49
8.3.60.0190.00316.50
8.3.50.0100.00916.23
8.3.40.0140.00418.67
8.3.30.0070.00718.71
8.3.20.0000.00721.82
8.3.10.0040.00421.89
8.3.00.0080.00019.79
8.2.180.0060.01518.06
8.2.170.0140.00722.96
8.2.160.0070.00720.37
8.2.150.0040.00424.18
8.2.140.0140.00024.66
8.2.130.0050.00320.34
8.2.120.0040.00426.35
8.2.110.0060.00320.98
8.2.100.0100.00017.84
8.2.90.0000.00817.88
8.2.80.0040.00418.05
8.2.70.0000.00917.93
8.2.60.0060.00318.22
8.2.50.0040.00418.10
8.2.40.0030.00522.40
8.2.30.0000.00819.33
8.2.20.0050.00318.04
8.2.10.0000.00718.07
8.2.00.0080.00018.17
8.1.280.0160.00025.92
8.1.270.0050.00318.82
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0130.00322.19
8.1.230.0070.00421.04
8.1.220.0030.00517.74
8.1.210.0060.00318.77
8.1.200.0060.00317.48
8.1.190.0060.00317.35
8.1.180.0000.01118.10
8.1.170.0000.00918.95
8.1.160.0030.00618.91
8.1.150.0000.00720.19
8.1.140.0000.00719.55
8.1.130.0030.00618.90
8.1.120.0070.00017.45
8.1.110.0000.00717.41
8.1.100.0040.00417.48
8.1.90.0050.00317.43
8.1.80.0040.00417.48
8.1.70.0070.00017.45
8.1.60.0080.00017.56
8.1.50.0040.00417.55
8.1.40.0040.00417.56
8.1.30.0000.00717.69
8.1.20.0060.00317.59
8.1.10.0000.00817.48
8.1.00.0040.00417.43
8.0.300.0000.00719.96
8.0.290.0000.00816.58
8.0.280.0030.00518.46
8.0.270.0000.00717.12
8.0.260.0030.00318.91
8.0.250.0000.00716.99
8.0.240.0040.00416.84
8.0.230.0050.00216.97
8.0.220.0030.00316.88
8.0.210.0030.00316.89
8.0.200.0030.00316.99
8.0.190.0060.00316.97
8.0.180.0050.00216.95
8.0.170.0000.00716.88
8.0.160.0000.00716.85
8.0.150.0000.00716.86
8.0.140.0000.00716.86
8.0.130.0030.00313.32
8.0.120.0070.00016.82
8.0.110.0040.00416.89
8.0.100.0080.00016.72
8.0.90.0000.00816.93
8.0.80.0060.00916.86
8.0.70.0080.00016.95
8.0.60.0040.00416.88
8.0.50.0040.00416.90
8.0.30.0110.00817.23
8.0.20.0120.00817.40
8.0.10.0040.00417.12
8.0.00.0150.01216.81
7.4.330.0020.00215.55
7.4.320.0030.00316.59
7.4.300.0030.00316.41
7.4.290.0020.00516.64
7.4.280.0000.00716.55
7.4.270.0070.00016.50
7.4.260.0030.00316.43
7.4.250.0000.00716.56
7.4.240.0040.00416.41
7.4.230.0030.00316.30
7.4.220.0070.01116.52
7.4.210.0100.01016.63
7.4.200.0070.00016.63
7.4.160.0080.00816.64
7.4.150.0110.00717.40
7.4.140.0120.00617.86
7.4.130.0070.01616.59
7.4.120.0130.00516.53
7.4.110.0040.01416.32
7.4.100.0140.00716.59
7.4.90.0140.00316.55
7.4.80.0030.01319.39
7.4.70.0100.00616.48
7.4.60.0150.00616.51
7.4.50.0030.01016.61
7.4.40.0100.00616.32
7.4.30.0080.01616.51
7.4.00.0020.01515.21
7.3.330.0000.00513.30
7.3.320.0030.00313.27
7.3.310.0070.00016.20
7.3.300.0000.00616.27
7.3.290.0080.00616.26
7.3.280.0090.00816.27
7.3.270.0060.01117.40
7.3.260.0130.00816.48
7.3.250.0110.00916.48
7.3.240.0070.01016.35
7.3.230.0030.01316.29
7.3.210.0030.01416.34
7.3.200.0050.01516.32
7.3.190.0040.01216.41
7.3.180.0030.01316.38
7.3.170.0070.01416.41
7.3.160.0030.01216.33
7.3.120.0110.00715.28
7.3.110.0030.01415.28
7.3.100.0030.01015.28
7.3.90.0140.00015.28
7.3.80.0120.00015.28
7.3.70.0060.01015.28
7.3.60.0000.01215.28
7.3.50.0050.00515.28
7.3.40.0040.00715.28
7.3.30.0030.01315.28
7.3.20.0060.00616.89
7.3.10.0060.00716.75
7.3.00.0090.00716.63
7.2.330.0110.00616.69
7.2.320.0110.00516.75
7.2.310.0110.01316.47
7.2.300.0120.00616.82
7.2.290.0100.00716.47
7.2.250.0030.01315.28
7.2.240.0030.01615.28
7.2.230.0030.01215.28
7.2.220.0030.01015.28
7.2.210.0040.00815.28
7.2.200.0090.00615.28
7.2.190.0040.01115.28
7.2.180.0060.00615.28
7.2.170.0030.00915.28
7.2.130.0050.01016.99
7.2.120.0050.00616.81
7.2.110.0040.00517.01
7.2.100.0040.00716.90
7.2.90.0050.00716.90
7.2.80.0030.00916.96
7.2.70.0070.00616.79
7.2.60.0060.00816.85
7.2.50.0040.00716.87
7.2.40.0020.01116.98
7.2.30.0050.00816.99
7.2.20.0030.00716.85
7.2.10.0040.00716.89
7.2.00.0080.00516.96
7.1.330.0090.00315.68
7.1.320.0100.00315.87
7.1.310.0070.00716.00
7.1.300.0030.01015.89
7.1.290.0040.00815.81
7.1.280.0110.00315.77
7.1.270.0000.01715.81
7.1.260.0030.00915.80
7.1.250.0030.00915.87
7.1.200.0060.00615.89
7.1.70.0000.01017.32
7.1.60.0970.01733.23
7.1.50.1030.00732.73
7.1.40.1070.01032.57
7.1.30.2400.01332.84
7.1.20.1500.01332.57
7.1.10.1330.01014.61
7.1.00.0870.01314.75
7.0.200.1670.00714.59
7.0.190.1030.01014.77
7.0.180.0800.01014.36
7.0.170.1570.01714.55
7.0.160.1530.00714.43
7.0.150.1030.01314.18
7.0.140.1130.00714.25
7.0.130.1030.01014.84
7.0.120.1100.01314.65
7.0.110.1370.01314.56
7.0.100.1600.01014.43
7.0.90.1370.00714.54
7.0.80.0900.01314.46
7.0.70.1400.01014.67
7.0.60.1100.00714.14
7.0.50.1100.00714.31
7.0.40.1300.01014.60
7.0.30.1000.01014.78
7.0.20.1130.01314.61
7.0.10.1600.01014.49
7.0.00.1200.01014.82

preferences:
64.39 ms | 401 KiB | 5 Q