3v4l.org

run code in 300+ PHP versions simultaneously
<?php $found = NULL; $data = array( false, "foo", false, "bar", true, "baz", true, "trololo", false, "huehue" ); $data = array_filter($data, function($x) use (&$found) { if($x[0]) { $found = $x; return false; } return true; }); echo "Found:\n"; var_dump($found); echo "Data:\n"; var_dump($data);
Output for git.master, git.master_jit
Warning: Trying to access array offset on value of type bool in /in/7Bq6Q on line 13 Warning: Trying to access array offset on value of type bool in /in/7Bq6Q on line 13 Warning: Trying to access array offset on value of type bool in /in/7Bq6Q on line 13 Warning: Trying to access array offset on value of type bool in /in/7Bq6Q on line 13 Warning: Trying to access array offset on value of type bool in /in/7Bq6Q on line 13 Found: string(6) "huehue" Data: array(5) { [0]=> bool(false) [2]=> bool(false) [4]=> bool(true) [6]=> bool(true) [8]=> bool(false) }
Output for rfc.property-hooks
Warning: Trying to access array offset on false in /in/7Bq6Q on line 13 Warning: Trying to access array offset on false in /in/7Bq6Q on line 13 Warning: Trying to access array offset on true in /in/7Bq6Q on line 13 Warning: Trying to access array offset on true in /in/7Bq6Q on line 13 Warning: Trying to access array offset on false in /in/7Bq6Q on line 13 Found: string(6) "huehue" Data: array(5) { [0]=> bool(false) [2]=> bool(false) [4]=> bool(true) [6]=> bool(true) [8]=> bool(false) }

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:
39.23 ms | 402 KiB | 8 Q