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($jobTiers);
Output for git.master, git.master_jit
Warning: Trying to access array offset on value of type int in /in/CuNGG on line 8 Warning: Trying to access array offset on value of type int in /in/CuNGG on line 8 Warning: Trying to access array offset on value of type int in /in/CuNGG on line 8 Warning: Trying to access array offset on value of type int in /in/CuNGG on line 8 Warning: Trying to access array offset on value of type int in /in/CuNGG on line 8 Warning: Trying to access array offset on value of type int in /in/CuNGG on line 8 Warning: Trying to access array offset on value of type int in /in/CuNGG on line 8 Warning: Trying to access array offset on value of type int in /in/CuNGG on line 8 array(2) { ["tier_1"]=> array(2) { ["jobs_to_inc"]=> int(10) ["jobs_to_dec"]=> int(8) } ["tier_2"]=> array(2) { ["jobs_to_inc"]=> int(20) ["jobs_to_dec"]=> int(16) } }
Output for rfc.property-hooks
Warning: Trying to access array offset on int in /in/CuNGG on line 8 Warning: Trying to access array offset on int in /in/CuNGG on line 8 Warning: Trying to access array offset on int in /in/CuNGG on line 8 Warning: Trying to access array offset on int in /in/CuNGG on line 8 Warning: Trying to access array offset on int in /in/CuNGG on line 8 Warning: Trying to access array offset on int in /in/CuNGG on line 8 Warning: Trying to access array offset on int in /in/CuNGG on line 8 Warning: Trying to access array offset on int in /in/CuNGG on line 8 array(2) { ["tier_1"]=> array(2) { ["jobs_to_inc"]=> int(10) ["jobs_to_dec"]=> int(8) } ["tier_2"]=> array(2) { ["jobs_to_inc"]=> int(20) ["jobs_to_dec"]=> int(16) } }

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