3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrays = [[0, 3, 10, 5, 6, 9, 2, 7, 1, 4, 8, 11], [0, 1, 2, 3], [0, 5, 2, 4, 3, 1], [0, 1, 3, 2]]; $deletes = [3, 5]; var_export( array_map( function($array) use ($deletes) { $result = []; foreach (array_diff($array, $deletes) as $value) { $result[] = array_reduce( $deletes, function ($carry, $item) use ($value) { return $carry - ($value > $item); }, $value ); } return $result; }, $arrays ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 0 => 0, 1 => 8, 2 => 4, 3 => 7, 4 => 2, 5 => 5, 6 => 1, 7 => 3, 8 => 6, 9 => 9, ), 1 => array ( 0 => 0, 1 => 1, 2 => 2, ), 2 => array ( 0 => 0, 1 => 2, 2 => 3, 3 => 1, ), 3 => array ( 0 => 0, 1 => 1, 2 => 2, ), )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
27.26 ms | 406 KiB | 5 Q