3v4l.org

run code in 200+ 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);

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch php-master
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)
Output for branch php-master+opcache
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)
Output for branch php-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)
Output for Typed properties v2
bool(true)
Output for Arrow functions
bool(true)
Output for Object typehint
bool(true)
Output for Array change keys
bool(true)
Output for Lexical anon
bool(true)

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