3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 if (!($jobCount >= $arr['jobs_to_dec'] && $jobCount <= $arr['jobs_to_inc'])) unset(current($jobTiers); //return ($jobCount >= $arr['jobs_to_dec'] && $jobCount <= $arr['jobs_to_inc']) ? $arr : false; }); var_dump($jobTiers);
Output for 5.3.0 - 5.5.3
Fatal error: Can't use function return value in write context in /in/An9pC on line 9
Process exited with code 255.