3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?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)
5.4.200.0050.03812.38
5.4.190.0190.04712.38
5.4.180.0130.04612.38
5.4.170.0140.04412.39
5.4.160.0190.04212.38
5.4.150.0190.04112.38
5.4.140.0160.04312.07
5.4.130.0150.04712.05
5.4.120.0150.04512.02
5.4.110.0180.04012.01
5.4.100.0150.04412.01
5.4.90.0190.04112.01
5.4.80.0210.03912.01
5.4.70.0290.09412.00
5.4.60.0170.05012.00
5.4.50.0160.04212.01
5.4.40.0490.07511.99
5.4.30.0170.04212.00
5.4.20.0150.04211.99
5.4.10.0160.04311.99
5.4.00.0170.04011.48
5.3.270.0170.04512.72
5.3.260.0160.04812.72
5.3.250.0250.04612.72
5.3.240.0210.04612.71
5.3.230.0190.04412.71
5.3.220.0270.06412.68
5.3.210.0250.04212.68
5.3.200.0230.03812.68
5.3.190.0210.04612.68
5.3.180.0240.04012.67
5.3.170.0150.05012.67
5.3.160.0190.05212.67
5.3.150.0190.05012.67
5.3.140.0190.04512.66
5.3.130.0150.05212.66
5.3.120.0370.09412.66
5.3.110.0170.04612.66
5.3.100.0160.04712.12
5.3.90.0180.04212.08
5.3.80.0240.04112.07
5.3.70.0180.04612.07
5.3.60.0160.04612.06
5.3.50.0450.08112.00
5.3.40.0180.04612.00
5.3.30.0240.04011.96
5.3.20.0230.04111.73
5.3.10.0200.04111.70
5.3.00.0170.04211.68

preferences:
143.69 ms | 1394 KiB | 7 Q