3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array(1, 2, 3, 4, 5, 6); // Creates a new anonymous function and assigns it to a variable $filter_even = function($item) { return ($item % 2) == 0; }; // Built-in array_filter accepts both the data and the function $output = array_filter($input, $filter_even); // The function doesn't need to be assigned to a variable. This is valid too: $output = array_filter($input, function($item) { return ($item % 2) == 0; }); print_r($output);

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.0120.00618.43
8.3.50.0090.01022.05
8.3.40.0120.00318.51
8.3.30.0140.00018.92
8.3.20.0000.00820.07
8.3.10.0040.00421.98
8.3.00.0050.00222.52
8.2.180.0150.00716.38
8.2.170.0070.00722.96
8.2.160.0110.00419.21
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00019.82
8.2.110.0030.01321.03
8.2.100.0070.00417.78
8.2.90.0050.00317.91
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0050.00518.04
8.2.50.0030.00518.07
8.2.40.0000.00718.22
8.2.30.0030.00518.10
8.2.20.0040.00417.67
8.2.10.0040.00417.86
8.2.00.0040.00417.63
8.1.280.0170.00325.92
8.1.270.0030.00522.19
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00621.75
8.1.230.0100.00020.88
8.1.220.0080.00017.77
8.1.210.0050.00519.02
8.1.200.0030.00617.34
8.1.190.0050.00317.64
8.1.180.0040.00418.84
8.1.170.0060.00318.65
8.1.160.0040.00422.16
8.1.150.0050.00218.66
8.1.140.0030.00517.46
8.1.130.0000.00717.67
8.1.120.0000.00717.37
8.1.110.0000.00717.45
8.1.100.0000.00717.44
8.1.90.0000.00817.44
8.1.80.0000.00717.45
8.1.70.0030.00317.48
8.1.60.0060.00317.62
8.1.50.0000.00717.55
8.1.40.0050.00217.45
8.1.30.0080.00017.66
8.1.20.0000.00817.63
8.1.10.0000.00817.53
8.1.00.0040.00417.47
8.0.300.0040.00420.02
8.0.290.0020.00517.18
8.0.280.0030.00518.38
8.0.270.0000.00717.25
8.0.260.0000.00716.79
8.0.250.0040.00416.96
8.0.240.0030.00316.97
8.0.230.0000.00716.95
8.0.220.0070.00016.83
8.0.210.0040.00416.77
8.0.200.0030.00316.96
8.0.190.0000.00716.96
8.0.180.0000.00816.95
8.0.170.0050.00316.82
8.0.160.0000.00716.91
8.0.150.0000.00716.66
8.0.140.0000.00816.90
8.0.130.0060.00013.34
8.0.120.0080.00016.79
8.0.110.0050.00216.81
8.0.100.0000.00816.95
8.0.90.0020.00516.89
8.0.80.0070.00716.88
8.0.70.0000.00716.80
8.0.60.0090.00016.87
8.0.50.0050.00316.85
8.0.30.0130.00516.94
8.0.20.0050.01217.40
8.0.10.0000.00717.00
8.0.00.0070.01016.72
7.4.330.0020.00215.09
7.4.320.0000.00616.55
7.4.300.0000.00616.43
7.4.290.0000.00716.50
7.4.280.0090.00016.39
7.4.270.0030.00316.65
7.4.260.0070.00016.45
7.4.250.0080.00016.44
7.4.240.0050.00216.52
7.4.230.0000.00716.61
7.4.220.0130.00616.70
7.4.210.0120.00416.59
7.4.200.0000.00716.58
7.4.190.0000.00716.78
7.4.160.0130.01016.61
7.4.150.0080.00817.40
7.4.140.0100.01017.86
7.4.130.0090.01116.48
7.4.120.0120.00616.62
7.4.110.0030.01316.79
7.4.100.0140.00416.43
7.4.90.0060.01216.53
7.4.80.0090.00919.39
7.4.70.0170.00016.41
7.4.60.0100.01016.37
7.4.50.0080.00016.47
7.4.40.0070.01022.77
7.4.30.0070.01716.68
7.4.00.0120.00315.06
7.3.330.0050.00013.11
7.3.320.0000.00513.29
7.3.310.0000.00716.12
7.3.300.0030.00316.31
7.3.290.0130.00616.30
7.3.280.0080.00816.31
7.3.270.0160.00717.40
7.3.260.0100.01316.32
7.3.250.0060.01016.43
7.3.240.0100.00716.34
7.3.230.0130.00316.44
7.3.210.0160.02016.40
7.3.200.0070.01019.39
7.3.190.0140.00316.27
7.3.180.0170.00416.46
7.3.170.0030.01316.59
7.3.160.0120.00316.48
7.3.120.0060.00915.05
7.3.110.0070.01015.05
7.3.100.0060.00914.84
7.3.90.0100.00614.81
7.3.80.0090.00614.86
7.3.70.0030.01114.74
7.3.60.0070.01014.71
7.3.50.0040.00914.93
7.3.40.0000.01414.72
7.3.30.0090.00314.64
7.3.20.0090.00616.43
7.3.10.0060.00816.29
7.3.00.0220.00616.02
7.2.330.0030.01516.30
7.2.320.0030.01916.54
7.2.310.0130.00916.62
7.2.300.0100.00716.39
7.2.290.0060.01616.72
7.2.240.0060.00614.85
7.2.230.0120.00015.15
7.2.220.0050.00515.07
7.2.210.0060.00914.98
7.2.200.0040.01514.82
7.2.190.0100.00615.05
7.2.180.0070.01115.07
7.2.170.0120.00315.01
7.2.160.0060.01015.02
7.2.150.0070.00716.77
7.2.140.0070.01016.98
7.2.130.0250.00716.18
7.2.120.0240.00716.33
7.2.110.0230.00716.19
7.2.100.0290.00816.22
7.2.90.0310.00916.23
7.2.80.0270.01316.36
7.2.70.0260.00816.22
7.2.60.0280.00516.42
7.2.50.0170.00716.25
7.2.40.0240.00616.12
7.2.30.0270.00616.21
7.2.20.0340.01016.30
7.2.10.0220.00816.18
7.2.00.0330.00616.36
7.1.330.0040.01115.97
7.1.320.0030.01015.57
7.1.310.0120.00315.77
7.1.300.0060.00615.67
7.1.290.0030.01015.73
7.1.280.0080.00815.67
7.1.270.0030.01015.56
7.1.260.0070.00715.56
7.1.250.0390.00715.28
7.1.240.1070.00914.10
7.1.230.0550.01413.91
7.1.220.1020.00713.63
7.1.210.0980.00013.79
7.1.200.0700.00615.02
7.1.190.0860.00713.84
7.1.180.0690.00313.81
7.1.170.0740.00413.72
7.1.160.0640.00614.05
7.1.150.0570.00714.09
7.1.140.1140.00714.00
7.1.130.0680.00713.63
7.1.120.1010.00313.80
7.1.110.0760.01013.76
7.1.100.0980.01313.83
7.1.90.0680.00013.96
7.1.80.1020.00013.85
7.1.70.0420.00515.56
7.1.60.0240.01616.90
7.1.50.0310.01315.39
7.1.40.0470.00913.97
7.1.30.0590.00714.09
7.1.20.0520.00313.97
7.1.10.0720.01013.84
7.1.00.0220.04218.19
7.0.330.0980.00313.50
7.0.320.1130.00713.71
7.0.310.0790.00613.66
7.0.300.0710.00813.50
7.0.290.0950.00413.71
7.0.280.0990.01013.27
7.0.270.0810.01013.52
7.0.260.0830.00813.51
7.0.250.1140.00313.51
7.0.240.1130.01013.54
7.0.230.0610.00713.78
7.0.220.0730.00813.45
7.0.210.0640.00713.48
7.0.200.0460.00315.09
7.0.190.0580.00613.74
7.0.180.0570.00613.56
7.0.170.0510.00013.68
7.0.160.0630.00613.55
7.0.150.0560.00913.70
7.0.140.1620.04317.61
7.0.130.0390.01213.67
7.0.120.0370.00313.77
7.0.110.0430.00413.63
7.0.100.0650.00613.43
7.0.90.0630.01013.59
7.0.80.0430.00313.47
7.0.70.0460.00613.51
7.0.60.0290.02816.72
7.0.50.0330.02615.70
7.0.40.0330.04216.93
7.0.30.0470.03216.76
7.0.20.0350.02716.96
7.0.10.0270.03116.81
7.0.00.0250.02616.95
5.6.380.0110.00814.23
5.6.370.0160.01014.49
5.6.360.0120.00914.09
5.6.350.0210.00014.37
5.6.340.0080.01214.21
5.6.330.0120.01414.19
5.6.320.0060.01514.36
5.6.310.0090.01314.57
5.6.300.0070.01014.55
5.6.290.0150.00514.61
5.6.280.0100.03817.65
5.6.270.0090.00914.38
5.6.260.0200.00414.29
5.6.250.0200.00514.11
5.6.240.0070.01114.00
5.6.230.0120.00614.17
5.6.220.0130.00914.30
5.6.210.0090.03517.42
5.6.200.0100.02316.18
5.6.190.0060.04117.50
5.6.180.2020.02417.46
5.6.170.0200.03817.33
5.6.160.0130.04317.40
5.6.150.0130.04016.29
5.6.140.0090.02516.22
5.6.130.0080.04516.18
5.6.120.0140.04417.59
5.6.110.0130.04417.75
5.6.100.0150.04017.53
5.6.90.0090.03717.69
5.6.80.0070.03417.31
5.6.70.1620.01517.26
5.6.60.0140.00414.28
5.6.50.0090.01414.15
5.6.40.0110.01114.04
5.6.30.0170.00314.32
5.6.20.0090.00914.04
5.6.10.0130.00914.09
5.6.00.0060.01214.07
5.5.380.0100.00510.86
5.5.370.0130.00310.85
5.5.360.0140.00311.12
5.5.350.0160.04115.70
5.5.340.0090.04314.62
5.5.330.0100.02015.69
5.5.320.0280.03115.75
5.5.310.0180.04115.58
5.5.300.0080.04714.49
5.5.290.0110.02014.54
5.5.280.0030.05316.02
5.5.270.0120.02016.06
5.5.260.0080.02515.96
5.5.250.0070.04415.72
5.5.240.0110.03715.49
5.5.230.0110.00411.16
5.5.220.0100.00510.89
5.5.210.0110.00211.14
5.5.200.0130.00411.13
5.5.190.0120.00410.94
5.5.180.0130.00310.96
5.5.170.0070.01111.03
5.5.160.0070.00710.90
5.5.150.0070.00711.05
5.5.140.0090.00510.95
5.5.130.0120.00410.87
5.5.120.0060.00910.91
5.5.110.0070.00711.15
5.5.100.0110.00711.13
5.5.90.0060.00611.10
5.5.80.0090.00911.08
5.5.70.0100.00310.92
5.5.60.0090.00610.92
5.5.50.0070.01011.18
5.5.40.0140.00311.19
5.5.30.0120.00310.81
5.5.20.0150.00010.99
5.5.10.0140.00011.16
5.5.00.0080.00410.93
5.4.450.0440.02515.16
5.4.440.0250.03515.16
5.4.430.0130.02815.30
5.4.420.0080.03115.32
5.4.410.0120.02815.10
5.4.400.0800.00514.86
5.4.390.0360.00314.80
5.4.380.0120.02914.75
5.4.370.0360.03514.90
5.4.360.0330.02714.84
5.4.350.0560.03414.77
5.4.340.0320.02814.94
5.4.330.0100.00510.96
5.4.320.0120.02111.75
5.4.310.0050.02411.74
5.4.300.0080.01911.88
5.4.290.0080.02111.73
5.4.280.0090.01811.59
5.4.270.0070.02511.71
5.4.260.0100.01911.66
5.4.250.0090.02211.76
5.4.240.0050.02311.72
5.4.230.0070.02411.64
5.4.220.0060.02611.57
5.4.210.0070.02211.73
5.4.200.0100.02611.81
5.4.190.0060.03014.90
5.4.180.0080.02815.16
5.4.170.0130.02714.96
5.4.160.0120.02815.00
5.4.150.0090.03414.87
5.4.140.0150.02213.73
5.4.130.0120.02913.68
5.4.120.0050.04213.58
5.4.110.0080.02813.75
5.4.100.0160.02013.89
5.4.90.0090.02613.66
5.4.80.0100.02313.82
5.4.70.0050.03113.85
5.4.60.0040.03213.74
5.4.50.0140.03013.66
5.4.40.0200.02613.78
5.4.30.0120.02313.69
5.4.20.0060.02913.74
5.4.10.0090.03013.77
5.4.00.0180.02013.36
5.3.290.0110.02111.68
5.3.280.0070.02211.54
5.3.270.0080.02812.54
5.3.260.0130.02512.45
5.3.250.0100.02812.57
5.3.240.0100.02512.43
5.3.230.0020.03312.54
5.3.220.0070.03612.51
5.3.210.0100.02912.45
5.3.200.0120.02212.55
5.3.190.0070.03012.43
5.3.180.0110.02312.54
5.3.170.0070.02812.58
5.3.160.0100.03012.62
5.3.150.0100.02712.45
5.3.140.0070.02812.46
5.3.130.0070.03012.50
5.3.120.0070.03512.56
5.3.110.0080.02812.53
5.3.100.0110.02312.31
5.3.90.0080.03012.25
5.3.80.0080.02512.20
5.3.70.0100.02612.11
5.3.60.0070.02912.29
5.3.50.0100.02312.13
5.3.40.0080.02812.15
5.3.30.0080.02812.16
5.3.20.0110.02512.05
5.3.10.0040.02911.91
5.3.00.0060.02712.01

preferences:
40.22 ms | 400 KiB | 5 Q