3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = json_decode('[ { "title": "Product One", "categories": ["one", "two"] }, { "title": "Product Two", "categories": ["two", "three"] }, { "title": "Product Three", "categories": ["three", "four"] } ]'); $result = []; foreach ($products as $row) { if (in_array('two', $row->categories)) { $result[] = $row; } } echo json_encode($result, JSON_PRETTY_PRINT);
Output for git.master_jit, git.master, rfc.property-hooks
[ { "title": "Product One", "categories": [ "one", "two" ] }, { "title": "Product Two", "categories": [ "two", "three" ] } ]

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:
27.67 ms | 406 KiB | 5 Q