3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'foo' => [ 'bar' => [ 'baz' => 'bat'] ] ]; $obj = new ArrayObject($array); $cb = function($obj) { $obj['foo']['bar'] = 'bazbat'; }; print_r($obj); $cb($obj); print_r($obj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XBfqT
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array, !1 = $obj, !2 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        NEW                                              $4      'ArrayObject'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
    6     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FXBfqT%3A6%240'
          6        ASSIGN                                                   !2, ~7
   11     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   12    10        INIT_DYNAMIC_CALL                                        !2
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
   13    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FXBfqT%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XBfqT
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        FETCH_DIM_W                                      $1      !0, 'foo'
          2        ASSIGN_DIM                                               $1, 'bar'
          3        OP_DATA                                                  'bazbat'
    8     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXBfqT%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.04 ms | 1395 KiB | 15 Q