3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { var $id; var $name; } $chaim = new Person(); $chaim->id = 1; $chaim->name = 'Chaim Brykman'; $sivan = new Person(); $sivan->id = 2; $sivan->name = 'Sivan Brykman'; $a = array($chaim, $sivan); $filtered = array_filter($a, function($i) { return $i->id == 2; })[1]; print_r($filtered);
Output for git.master, git.master_jit, rfc.property-hooks
Person Object ( [id] => 2 [name] => Sivan Brykman )

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