3v4l.org

run code in 300+ PHP versions simultaneously
<?php $jobTiers = array("tier_1" => array("jobs_to_inc" => 10, "jobs_to_dec" => 8), "tier_2" => array("jobs_to_inc" => 20, "jobs_to_dec" => 16)); $jobCount = 10; $test = array_walk_recursive($jobTiers, function($arr) use ($jobCount) { // I want it to return the array where jobCount is in-between jobs_to_dec and jobs_to_inc return ($jobCount >= $arr['jobs_to_dec'] && $jobCount <= $arr['jobs_to_inc']) ? $arr : false; }); var_dump($test);
Output for git.master, git.master_jit
Warning: Trying to access array offset on value of type int in /in/37nUK on line 8 Warning: Trying to access array offset on value of type int in /in/37nUK on line 8 Warning: Trying to access array offset on value of type int in /in/37nUK on line 8 Warning: Trying to access array offset on value of type int in /in/37nUK on line 8 Warning: Trying to access array offset on value of type int in /in/37nUK on line 8 Warning: Trying to access array offset on value of type int in /in/37nUK on line 8 Warning: Trying to access array offset on value of type int in /in/37nUK on line 8 Warning: Trying to access array offset on value of type int in /in/37nUK on line 8 bool(true)

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:
13.64 ms | 410 KiB | 5 Q