3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_partition($array, $callback, $recursive = true) { $ret = array (); $walk = ($recursive) ? 'array_walk_recursive' : 'array_walk'; $walk ( $array, function ($value, $key) use($callback, &$ret) { $index = call_user_func_array ( $callback, array ( $value, $key ) ); if (isset ( $ret [$index] )) $ret [$index] [] = $value; else $ret [$index] = array ( $value ); } ); return $ret; } $p1 = (object) array('a'=>1,'b'=>2); $p2 = (object) array('a'=>1,'b'=>3); $p3 = (object) array('a'=>2,'b'=>4); $posts[] = $p1; $posts[] = $p2; $posts[] = $p3; $posts = array_partition($posts, function ($post, $i) { return $post->a; }, false); print_r($posts); ?>

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.0070.01018.55
8.3.50.0120.00316.62
8.3.40.0000.01418.96
8.3.30.0100.00718.84
8.3.20.0040.00418.74
8.3.10.0040.00421.98
8.3.00.0040.00420.94
8.2.180.0110.00318.29
8.2.170.0100.01022.96
8.2.160.0000.01419.34
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0050.00322.30
8.2.120.0050.00326.35
8.2.110.0030.00620.35
8.2.100.0120.00017.84
8.2.90.0080.00017.84
8.2.80.0080.00018.05
8.2.70.0070.00317.50
8.2.60.0090.00617.55
8.2.50.0000.00818.10
8.2.40.0050.00320.46
8.2.30.0000.00720.66
8.2.20.0040.00417.82
8.2.10.0080.00018.14
8.2.00.0000.00718.20
8.1.280.0070.01025.92
8.1.270.0030.00523.97
8.1.260.0040.00428.09
8.1.250.0050.00328.09
8.1.240.0100.00317.36
8.1.230.0110.00020.97
8.1.220.0050.00317.75
8.1.210.0000.00818.77
8.1.200.0000.00917.35
8.1.190.0050.00317.36
8.1.180.0050.00318.10
8.1.170.0050.00318.64
8.1.160.0000.00720.97
8.1.150.0000.00818.83
8.1.140.0000.00719.47
8.1.130.0070.00017.73
8.1.120.0000.00717.38
8.1.110.0070.00017.49
8.1.100.0000.00717.40
8.1.90.0050.00217.48
8.1.80.0080.00017.38
8.1.70.0000.00717.39
8.1.60.0040.00417.61
8.1.50.0080.00017.54
8.1.40.0000.01217.44
8.1.30.0030.00517.51
8.1.20.0000.00717.55
8.1.10.0040.00417.55
8.1.00.0050.00217.44
8.0.300.0000.00719.62
8.0.290.0020.00516.75
8.0.280.0000.00718.36
8.0.270.0040.00417.27
8.0.260.0030.00317.27
8.0.250.0000.00716.94
8.0.240.0040.00416.90
8.0.230.0000.00717.03
8.0.220.0070.00016.87
8.0.210.0000.00816.92
8.0.200.0060.00317.02
8.0.190.0030.00617.05
8.0.180.0030.00617.05
8.0.170.0040.00416.98
8.0.160.0040.00416.94
8.0.150.0000.00716.86
8.0.140.0000.00716.83
8.0.130.0030.00313.38
8.0.120.0040.00416.84
8.0.110.0040.00416.79
8.0.100.0000.00716.79
8.0.90.0000.00716.76
8.0.80.0030.01616.93
8.0.70.0040.00416.92
8.0.60.0040.00416.84
8.0.50.0040.00416.82
8.0.30.0080.00817.02
8.0.20.0190.00317.40
8.0.10.0040.00417.01
8.0.00.0140.00916.83
7.4.330.0050.00015.08
7.4.320.0060.00016.59
7.4.300.0050.00316.64
7.4.290.0000.00816.62
7.4.280.0040.00416.43
7.4.270.0040.00416.57
7.4.260.0030.00316.56
7.4.250.0000.00816.50
7.4.240.0050.00216.64
7.4.230.0000.00716.40
7.4.220.0040.01616.59
7.4.210.0040.01116.62
7.4.200.0070.00016.43
7.4.160.0110.00416.34
7.4.150.0090.00917.40
7.4.140.0170.00317.86
7.4.130.0140.00816.60
7.4.120.0070.01016.49
7.4.110.0070.01016.66
7.4.100.0060.01216.59
7.4.90.0000.01616.60
7.4.80.0090.00919.39
7.4.70.0050.01116.36
7.4.60.0100.00716.46
7.4.50.0030.01016.51
7.4.40.0120.00416.66
7.4.30.0060.00916.32
7.4.00.0040.01414.70
7.3.330.0000.00513.41
7.3.320.0000.00713.38
7.3.310.0000.00716.54
7.3.300.0030.00316.46
7.3.290.0070.01116.46
7.3.280.0070.01116.44
7.3.270.0130.00817.40
7.3.260.0140.00316.53
7.3.250.0140.00616.38
7.3.240.0080.01116.54
7.3.230.0060.01016.65
7.3.210.0070.01016.65
7.3.200.0130.00316.45
7.3.190.0130.00316.32
7.3.180.0150.00016.46
7.3.170.0100.01316.61
7.3.160.0120.00416.63
7.3.120.0120.00614.91
7.3.110.0100.00715.01
7.3.100.0070.00714.96
7.3.90.0120.00315.11
7.3.80.0070.00715.14
7.3.70.0060.00614.90
7.3.60.0120.00314.82
7.3.50.0000.00914.79
7.3.40.0030.01314.83
7.3.30.0080.00814.88
7.3.20.0110.00416.76
7.3.10.0000.01416.92
7.3.00.0080.00316.50
7.2.330.0030.01416.51
7.2.320.0080.01116.92
7.2.310.0100.01016.68
7.2.300.0040.01216.84
7.2.290.0070.01516.45
7.2.250.0100.01014.91
7.2.240.0030.01715.00
7.2.230.0060.00914.92
7.2.220.0100.00314.91
7.2.210.0100.00714.93
7.2.200.0100.00315.27
7.2.190.0030.00914.88
7.2.180.0080.00314.95
7.2.170.0000.01615.02
7.2.60.0070.01016.93
7.1.330.0030.01415.94
7.1.320.0130.00316.01
7.1.310.0080.00815.80
7.1.300.0070.00315.65
7.1.290.0030.00615.84
7.1.280.0060.00615.67
7.1.270.0070.01015.52
7.1.260.0030.01615.69
7.1.200.0070.00715.75
7.1.100.0040.01118.09
7.1.70.0060.00617.32
7.1.60.0100.01420.41
7.1.00.0100.06722.24
7.0.200.0480.00614.96
7.0.60.0000.06721.88
7.0.50.0030.05317.86
7.0.40.0200.05720.30
7.0.30.0230.04720.39
7.0.20.0130.06320.40
7.0.10.0100.06720.04
7.0.00.0470.04720.39
5.6.280.0030.07320.93
5.6.210.0070.06720.72
5.6.200.0030.08018.19
5.6.190.0100.06320.45
5.6.180.0230.06020.46
5.6.170.0170.05320.45
5.6.160.0230.06020.60
5.6.150.0270.06020.41
5.6.140.0200.06020.37
5.6.130.0130.07320.35
5.6.120.0370.06020.38
5.6.110.0500.08720.39
5.6.100.0330.07020.35
5.6.90.0370.06720.42
5.6.80.0300.06719.69
5.6.70.0400.05319.80
5.6.60.0200.06319.79
5.6.50.0270.05019.75
5.6.40.0370.05719.66
5.6.30.0200.05319.72
5.6.20.0230.07719.72
5.6.10.0230.06019.75
5.6.00.0200.05019.65
5.5.350.0230.07720.48
5.5.340.0130.07717.95
5.5.330.0170.05320.25
5.5.320.0130.06320.57
5.5.310.0370.06320.37
5.5.300.0070.06720.11
5.5.290.0400.06320.07
5.5.280.0470.06020.12
5.5.270.0200.07720.10
5.5.260.0400.06320.17
5.5.250.0230.06319.96
5.5.240.0370.05319.77
5.5.230.0300.05719.48
5.5.220.0330.05019.50
5.5.210.0100.05719.58
5.5.200.0400.05019.48
5.5.190.0230.06319.56
5.5.180.0200.07719.42
5.5.160.0170.05719.61
5.5.150.0270.05019.54
5.5.140.0330.04319.54
5.5.130.0300.07019.59
5.5.120.0230.07319.54
5.5.110.0170.08019.57
5.5.100.0200.07019.39
5.5.90.0230.05019.42
5.5.80.0170.05319.44
5.5.70.0200.06019.49
5.5.60.0130.06019.39
5.5.50.0170.05019.41
5.5.40.0070.06019.32
5.5.30.0170.05319.63
5.5.20.0230.05019.47
5.5.10.0170.05319.36
5.5.00.0170.06319.36

preferences:
68.79 ms | 400 KiB | 5 Q