3v4l.org

run code in 300+ PHP versions simultaneously
<?php $newArray = array ( 0 => 0.393, 1 => 0.769, 2 => 0.189, 3 => 0, 4 => 0, 5 => 0.349, 6 => 0.686, 7 => 0.168, 8 => 0, 9 => 0, 10 => 0.272, 11 => 0.534, 12 => 0.131, 13 => 1, 14 => 0 ); $newArray = array_filter($newArray, function ($k) { return $k % 5 < 3; }, ARRAY_FILTER_USE_KEY ); print_r($newArray); $newArray = array_values($newArray); print_r($newArray);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 0.393 [1] => 0.769 [2] => 0.189 [5] => 0.349 [6] => 0.686 [7] => 0.168 [10] => 0.272 [11] => 0.534 [12] => 0.131 ) Array ( [0] => 0.393 [1] => 0.769 [2] => 0.189 [3] => 0.349 [4] => 0.686 [5] => 0.168 [6] => 0.272 [7] => 0.534 [8] => 0.131 )

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.75 ms | 406 KiB | 5 Q