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);
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 >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 10
    6     2        INIT_FCALL                                               'array_walk_recursive'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
          5        BIND_LEXICAL                                             ~5, !1
    9     6        SEND_VAL                                                 ~5
    6     7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !2, $6
   11     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
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        IS_SMALLER_OR_EQUAL                              ~3      ~2, !1
          4      > JMPZ_EX                                          ~3      ~3, ->8
          5    >   FETCH_DIM_R                                      ~4      !0, 'jobs_to_inc'
          6        IS_SMALLER_OR_EQUAL                              ~5      !1, ~4
          7        BOOL                                             ~3      ~5
          8    > > JMPZ                                                     ~3, ->11
          9    >   QM_ASSIGN                                        ~6      !0
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~6      <false>
         12    > > RETURN                                                   ~6
    9    13*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.11 ms | 1461 KiB | 15 Q