3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(ticks=1); function tick() { global $ticks; if ($ticks) { $tick = array_shift($ticks); $tick(); } } register_tick_function('tick'); class A { protected $b = ['d' => 321]; function & __get($name) { echo "And now, __get is running...\n"; $GLOBALS['ticks'][] = function () { echo "THIS IS WHERE WE VALIDATE CHANGES TO THE ARRAY!\n"; }; return $this->{$name}; } } eval(' $a = new A(); $a->b["c"] = 123; var_dump($a->b); ');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pnq81
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   TICKS                                                    
   12     1        INIT_FCALL                                               'register_tick_function'
          2        SEND_VAL                                                 'tick'
          3        DO_ICALL                                                 
          4        TICKS                                                    
   28     5        INCLUDE_OR_EVAL                                          '%0A%24a+%3D+new+A%28%29%3B%0A%24a-%3Eb%5B%22c%22%5D+%3D+123%3B+%0Avar_dump%28%24a-%3Eb%29%3B%0A', EVAL
          6        TICKS                                                    
   32     7      > RETURN                                                   1

Function tick:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/pnq81
function name:  tick
number of ops:  12
compiled vars:  !0 = $ticks, !1 = $tick
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_GLOBAL                                              !0, 'ticks'
          1        TICKS                                                    
    6     2      > JMPZ                                                     !0, ->11
    7     3    >   INIT_FCALL                                               'array_shift'
          4        SEND_REF                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !1, $2
          7        TICKS                                                    
    8     8        INIT_DYNAMIC_CALL                                        !1
          9        DO_FCALL                                      0          
         10        TICKS                                                    
   10    11    > > RETURN                                                   null

End of function tick

Function %00%7Bclosure%7D%2Fin%2Fpnq81%3A21%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pnq81
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   ECHO                                                     'THIS+IS+WHERE+WE+VALIDATE+CHANGES+TO+THE+ARRAY%21%0A'
          1        TICKS                                                    
   23     2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fpnq81%3A21%240

Class A:
Function __get:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/pnq81
function name:  __get
number of ops:  13
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        ECHO                                                     'And+now%2C+__get+is+running...%0A'
          2        TICKS                                                    
   21     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fpnq81%3A21%240'
          4        FETCH_W                      global              $1      'GLOBALS'
          5        FETCH_DIM_W                                      $2      $1, 'ticks'
          6        ASSIGN_DIM                                               $2
   23     7        OP_DATA                                                  ~4
          8        TICKS                                                    
   24     9        FETCH_OBJ_W                                      $5      !0
         10      > RETURN_BY_REF                                            $5
         11*       TICKS                                                    
   25    12*     > RETURN_BY_REF                                            null

End of function __get

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.84 ms | 1400 KiB | 17 Q