3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( array("id" => 1, "name" => "njx", "count" => 0), array("id" => 2, "name" => "peter", "count" => 4), array("id" => 3, "name" => "jeffry", "count" => 2), array("id" => 4, "name" => "adam", "count" => 6) ); $fa = array_filter($a, function ($item) { return ($item["count"] > 0); }); function comp() { // whatever return 1; } usort($fa, 'comp'); foreach ($fa as &$t) { $t["score"] = 120; } var_dump($a); //this doesn't contain "score" field.
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { [0]=> array(3) { ["id"]=> int(1) ["name"]=> string(3) "njx" ["count"]=> int(0) } [1]=> array(3) { ["id"]=> int(2) ["name"]=> string(5) "peter" ["count"]=> int(4) } [2]=> array(3) { ["id"]=> int(3) ["name"]=> string(6) "jeffry" ["count"]=> int(2) } [3]=> array(3) { ["id"]=> int(4) ["name"]=> string(4) "adam" ["count"]=> int(6) } }

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