3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=[' ', ' foo ', ' ', ' bar ', 'baz ', ' ']; function something(array $arg) { array_filter($arg, function(&$el){return strlen($el=trim($el));}); } var_dump($arr); something($arr); var_dump($arr);
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { [0]=> string(3) " " [1]=> string(7) " foo " [2]=> string(3) " " [3]=> string(8) " bar " [4]=> string(6) "baz " [5]=> string(2) " " } Warning: {closure}(): Argument #1 ($el) must be passed by reference, value given in /in/K7bRf on line 7 Warning: {closure}(): Argument #1 ($el) must be passed by reference, value given in /in/K7bRf on line 7 Warning: {closure}(): Argument #1 ($el) must be passed by reference, value given in /in/K7bRf on line 7 Warning: {closure}(): Argument #1 ($el) must be passed by reference, value given in /in/K7bRf on line 7 Warning: {closure}(): Argument #1 ($el) must be passed by reference, value given in /in/K7bRf on line 7 Warning: {closure}(): Argument #1 ($el) must be passed by reference, value given in /in/K7bRf on line 7 array(6) { [0]=> string(3) " " [1]=> string(7) " foo " [2]=> string(3) " " [3]=> string(8) " bar " [4]=> string(6) "baz " [5]=> string(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:
22.35 ms | 403 KiB | 8 Q