3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NumericComparisonFilter { private $reference; function __construct($reference) { $this->reference = $reference; } function isLower($num) { return $num < $this->reference; } function isGreater($num) { return $num > $this->reference; } function isEqual($num) { return $num == $this->reference; } } $arr = array(7, 8, 9, 10, 11, 12, 13); $matches = array_filter($arr, array(new NumericComparisonFilter(10), 'isLower')); print_r($matches); $matches = array_filter($arr, array(new NumericComparisonFilter(10), 'isGreater')); print_r($matches); $matches = array_filter($arr, array(new NumericComparisonFilter(10), 'isEqual')); print_r($matches);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 7 [1] => 8 [2] => 9 ) Array ( [4] => 11 [5] => 12 [6] => 13 ) Array ( [3] => 10 )

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