3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bookData = []; foreach ([1, 2, 3, 5, 8, 13, 21] as $value) { $book = new stdClass; $book->price = $value; $bookData[] = $book; } $priceFilter = function($minimumValue, $maximumValue) { return function($value) use ($minimumValue, $maximumValue) { return $value->price >= $minimumValue && $value->price < $maximumValue; }; }; $filteredArrayData = array_filter( $bookData, $priceFilter(5.00, 15.00) ); var_dump($filteredArrayData);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [3]=> object(stdClass)#4 (1) { ["price"]=> int(5) } [4]=> object(stdClass)#5 (1) { ["price"]=> int(8) } [5]=> object(stdClass)#6 (1) { ["price"]=> int(13) } }

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