3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = [ (object)['name' => 'Something', 'link' => 'high/over/there'], (object)['name' => 'Items', 'link' => 'this/is/foo/bar'], ]; array_walk($list, function ($v) { if ($v->name == 'Items') $v->link = dirname($v->link); }); var_export($list);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cbIHX
function name:  (null)
number of ops:  14
compiled vars:  !0 = $list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   CAST                                          8  ~1      <array>
          1        INIT_ARRAY                                       ~2      ~1
    5     2        CAST                                          8  ~3      <array>
          3        ADD_ARRAY_ELEMENT                                ~2      ~3
    3     4        ASSIGN                                                   !0, ~2
    8     5        INIT_FCALL                                               'array_walk'
          6        SEND_REF                                                 !0
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcbIHX%3A8%240'
   10     8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
   12    10        INIT_FCALL                                               'var_export'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FcbIHX%3A8%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/cbIHX
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        FETCH_OBJ_R                                      ~1      !0, 'name'
          2        IS_EQUAL                                                 ~1, 'Items'
          3      > JMPZ                                                     ~2, ->10
          4    >   INIT_FCALL                                               'dirname'
          5        FETCH_OBJ_R                                      ~4      !0, 'link'
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
          8        ASSIGN_OBJ                                               !0, 'link'
          9        OP_DATA                                                  $5
   10    10    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcbIHX%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
13.37 ms | 411 KiB | 7 Q