3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dataArray = array( array( 20800, 21679, 0 ), array( 15254, 0, 3726 ), array( 17426, 2973, 0 ), array( 4391, 37, 0 ), array( 39194, 435, 0 ) ); $arr = [0,0,0]; foreach($dataArray as &$da){ $da = array_replace(array_fill(0,count($da),1), array_intersect($da, $arr)); } Var_dump($dataArray);
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { [0]=> array(3) { [0]=> int(1) [1]=> int(1) [2]=> int(0) } [1]=> array(3) { [0]=> int(1) [1]=> int(0) [2]=> int(1) } [2]=> array(3) { [0]=> int(1) [1]=> int(1) [2]=> int(0) } [3]=> array(3) { [0]=> int(1) [1]=> int(1) [2]=> int(0) } [4]=> &array(3) { [0]=> int(1) [1]=> int(1) [2]=> int(0) } }

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:
162.24 ms | 406 KiB | 5 Q