3v4l.org

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

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

End of function assign

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.83 ms | 1389 KiB | 16 Q