3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ValueFilter { private $minimumValue; private $maximumValue; public function __construct($min, $max) { $this->minimumValue = $min; $this->maximumValue = $max; } public function __invoke($value) { return $value >= $this->minimumValue && $value < $this->maximumValue; } } $values = [1, 2, 3, 5, 8, 13, 21]; print_r(array_filter($values, new ValueFilter(5, 20))); print_r(array_filter($values, new ValueFilter(2, 6)));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [3] => 5 [4] => 8 [5] => 13 ) Array ( [1] => 2 [2] => 3 [3] => 5 )

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