3v4l.org

run code in 300+ PHP versions simultaneously
<?php function func($a){ $a[0]->prop='new value'; } $b=new stdClass(); $b->prop='value'; $a=array($b, 2, 3, 4); print_r($a); func($a); print_r($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hg8gj
function name:  (null)
number of ops:  20
compiled vars:  !0 = $b, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $2      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    7     3        ASSIGN_OBJ                                               !0, 'prop'
          4        OP_DATA                                                  'value'
    8     5        INIT_ARRAY                                       ~6      !0
          6        ADD_ARRAY_ELEMENT                                ~6      2
          7        ADD_ARRAY_ELEMENT                                ~6      3
          8        ADD_ARRAY_ELEMENT                                ~6      4
          9        ASSIGN                                                   !1, ~6
    9    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
   10    13        INIT_FCALL                                               'func'
         14        SEND_VAR                                                 !1
         15        DO_FCALL                                      0          
   11    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hg8gj
function name:  func
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_DIM_W                                      $1      !0, 0
          2        ASSIGN_OBJ                                               $1, 'prop'
          3        OP_DATA                                                  'new+value'
    5     4      > RETURN                                                   null

End of function func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.62 ms | 1389 KiB | 16 Q