3v4l.org

run code in 300+ PHP versions simultaneously
<?php function any($elements, Callable $x){ foreach($elements as $element){ if($x($element)) return true; } return false; } function all($elements, Callable $x){ foreach($elements as $element){ if(!$x($element)) return false; } return true; } function minimum($of) { return function($el) use ($of){ if($el < $of) return true; return false; }; } echo "any x <- [1, 2, 3, 4, 5] | < 5" . PHP_EOL; if(any(array(1, 2, 3, 4, 5), minimum(5))) { echo "true" . PHP_EOL; } else { echo "false" . PHP_EOL; }; echo "all x <- [1, 2, 3, 4] | < 5" . PHP_EOL; if(all(array(1, 2, 3, 4), minimum(5))) { echo "true" . PHP_EOL; } else { echo "false" . PHP_EOL; };
Output for git.master, git.master_jit, rfc.property-hooks
any x <- [1, 2, 3, 4, 5] | < 5 true all x <- [1, 2, 3, 4] | < 5 true

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:
56.84 ms | 401 KiB | 8 Q