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); $obj->foo = bar; print_r($obj); print_r((array)$obj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UpXPc
function name:  (null)
number of ops:  27
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%2FUpXPc%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                                                 
   15    16        FETCH_CONSTANT                                   ~13     'bar'
         17        ASSIGN_OBJ                                               !1, 'foo'
         18        OP_DATA                                                  ~13
   16    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
   18    22        INIT_FCALL                                               'print_r'
         23        CAST                                          7  ~15     !1
         24        SEND_VAL                                                 ~15
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FUpXPc%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UpXPc
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%2FUpXPc%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.66 ms | 1396 KiB | 15 Q