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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/37nUK
function name:  (null)
number of ops:  13
compiled vars:  !0 = $jobTiers, !1 = $jobCount, !2 = $test
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   QM_ASSIGN                                                !0
   4     1        QM_ASSIGN                                                !1
   6     2        INIT_FCALL                                               'array_walk_recursive'
         3        SEND_REF                                                 !0
         4        RAISE_ABSTRACT_ERROR                             ~5      '%00%7Bclosure%7D%2Fin%2F37nUK0x7f4bc467a1ad'
         5        BIND_LEXICAL                                             ~5, !1
   9     6        SEND_VAL                                                 ~5
         7        DO_ICALL                                         $6      
         8        QM_ASSIGN                                                !2
  11     9        INIT_FCALL                                               'var_dump'
        10        SEND_VAR                                                 !2
        11        DO_ICALL                                                 
        12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F37nUK0x7f4bc467a1ad:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/37nUK
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $arr, !1 = $jobCount
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   6     0  E >   RECV                                             !0      
         1        BIND_STATIC                                              !1
   8     2        FETCH_DIM_R                                      ~2      !0, 'jobs_to_dec'
         3        CAST                                          0  ~3      ~2, !1
         4      > JMPZ_EX                                          ~3      ~3, ->8
         5    >   FETCH_DIM_R                                      ~4      !0, 'jobs_to_inc'
         6        CAST                                          0  ~5      !1, ~4
         7        BOOL                                             ~3      ~5
         8    > > JMPZ                                                     ~3, ->11
         9    >   ASSIGN_BW_OR                                  0  ~6      !0
        10      > JMP                                                      ->12
        11    >   ASSIGN_BW_OR                                  0  ~6      <false>
        12    > > RETURN                                                   ~6
   9    13*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F37nUK0x7f4bc467a1ad

Generated using Vulcan Logic Dumper, using php 7.4.0