3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B { } class A { static $var; static function get() { if (isset(self::$var)) return self::$var; $x = new B(); $x->Children = array(0 => new B()); self::$var = $x; return $x; } } $a = A::get(); var_dump($a); unset($a->Children[0]); var_dump($a); $b = A::get(); var_dump($b); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fTWPo
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'get'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   22     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   24     6        FETCH_OBJ_UNSET                                  $5      !0, 'Children'
          7        UNSET_DIM                                                $5, 0
   26     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   28    11        INIT_STATIC_METHOD_CALL                                  'A', 'get'
         12        DO_FCALL                                      0  $7      
         13        ASSIGN                                                   !1, $7
   30    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
   31    17      > RETURN                                                   1

Class B: [no user functions]
Class A:
Function get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fTWPo
function name:  get
number of ops:  16
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ISSET_ISEMPTY_STATIC_PROP                                'var'
          1      > JMPZ                                                     ~1, ->4
   11     2    >   FETCH_STATIC_PROP_R          unknown             ~2      'var'
          3      > RETURN                                                   ~2
   13     4    >   NEW                                              $3      'B'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   14     7        NEW                                              $7      'B'
          8        DO_FCALL                                      0          
          9        INIT_ARRAY                                       ~9      $7, 0
         10        ASSIGN_OBJ                                               !0, 'Children'
         11        OP_DATA                                                  ~9
   15    12        ASSIGN_STATIC_PROP                                       'var'
         13        OP_DATA                                                  !0
   16    14      > RETURN                                                   !0
   17    15*     > RETURN                                                   null

End of function get

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.78 ms | 1396 KiB | 15 Q