3v4l.org

run code in 300+ PHP versions simultaneously
<?php $empty = function(&$v) use (&$empty) { if (is_array($v)) { $v = array_filter($v, $empty); } elseif (!empty($v)) { $v = $v . 'modified'; } return !empty($v); }; $a = ['',['',['a', 'b'],'c'],'d']; $b = $a; var_dump(array_filter($b, $empty)); ?><hr><?php var_dump($a);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: {closure}(): Argument #1 ($v) must be passed by reference, value given in /in/irv2H on line 18 Warning: {closure}(): Argument #1 ($v) must be passed by reference, value given in /in/irv2H on line 18 Warning: {closure}(): Argument #1 ($v) must be passed by reference, value given in /in/irv2H on line 7 Warning: {closure}(): Argument #1 ($v) must be passed by reference, value given in /in/irv2H on line 7 Warning: {closure}(): Argument #1 ($v) must be passed by reference, value given in /in/irv2H on line 7 Warning: {closure}(): Argument #1 ($v) must be passed by reference, value given in /in/irv2H on line 7 Warning: {closure}(): Argument #1 ($v) must be passed by reference, value given in /in/irv2H on line 7 Warning: {closure}(): Argument #1 ($v) must be passed by reference, value given in /in/irv2H on line 18 array(2) { [1]=> array(3) { [0]=> string(0) "" [1]=> array(2) { [0]=> string(1) "a" [1]=> string(1) "b" } [2]=> string(1) "c" } [2]=> string(1) "d" } <hr>array(3) { [0]=> string(0) "" [1]=> array(3) { [0]=> string(0) "" [1]=> array(2) { [0]=> string(1) "a" [1]=> string(1) "b" } [2]=> string(1) "c" } [2]=> string(1) "d" }

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:
45.61 ms | 404 KiB | 8 Q