3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DICT { } $a = new DICT; $a->b = function(){ echo 'b'; }; $a->c = new DICT; $a->b(); // работает $a->c->d = function(){ echo 'd'; }; $a->c->d();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gc6bJ
function name:  (null)
number of ops:  20
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'DICT'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGc6bJ%3A10%240'
          4        ASSIGN_OBJ                                               !0, 'b'
          5        OP_DATA                                                  ~5
   11     6        NEW                                              $7      'DICT'
          7        DO_FCALL                                      0          
          8        ASSIGN_OBJ                                               !0, 'c'
          9        OP_DATA                                                  $7
   12    10        INIT_METHOD_CALL                                         !0, 'b'
         11        DO_FCALL                                      0          
   13    12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGc6bJ%3A13%241'
         13        FETCH_OBJ_W                                      $10     !0, 'c'
         14        ASSIGN_OBJ                                               $10, 'd'
         15        OP_DATA                                                  ~12
   14    16        FETCH_OBJ_R                                      ~13     !0, 'c'
         17        INIT_METHOD_CALL                                         ~13, 'd'
         18        DO_FCALL                                      0          
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FGc6bJ%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gc6bJ
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'b'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FGc6bJ%3A10%240

Function %00%7Bclosure%7D%2Fin%2FGc6bJ%3A13%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gc6bJ
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'd'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FGc6bJ%3A13%241

Class DICT: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.7 ms | 1395 KiB | 13 Q