3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Creates an anonymous filter function accepting items > $min * * Returns a single filter out of a family of "greater than n" filters */ function criteria_greater_than($min) { return function($itemio) use ($min) { var_dump($itemio); return $itemio > $min; }; } $input = array(1, 2, 3, 4, 5, 6); // Use array_filter on a input with a selected filter function $output = array_filter($input, criteria_greater_than(3)); print_r($output); // items > 3
Output for git.master_jit, git.master, rfc.property-hooks
int(1) int(2) int(3) int(4) int(5) int(6) Array ( [3] => 4 [4] => 5 [5] => 6 )

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