3v4l.org

run code in 300+ PHP versions simultaneously
<?php $t = function(){ var_dump($this); var_dump(get_class($this)); }; $t();die; abstract class T { static public $instanses; final private function __construct(){ } public static function getInstance() { var_dump(static::$instanses); if (!(static::$instanses instanceof static)) { static::$instanses = new static; } var_dump(static::$instanses); return static::$instanses; } } class A extends T { static public $instanses; } class B extends A { static public $instanses; } $t = A::getInstance(); var_dump($t); $t1 = B::getInstance(); var_dump($t1); new B(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/lFli5
function name:  (null)
number of ops:  21
compiled vars:  !0 = $t, !1 = $t1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FlFli5%3A3%240'
          1        ASSIGN                                                   !0, ~2
    8     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
          4      > EXIT                                                     
   39     5*       INIT_STATIC_METHOD_CALL                                  'A', 'getInstance'
          6*       DO_FCALL                                      0  $5      
          7*       ASSIGN                                                   !0, $5
   40     8*       INIT_FCALL                                               'var_dump'
          9*       SEND_VAR                                                 !0
         10*       DO_ICALL                                                 
   42    11*       INIT_STATIC_METHOD_CALL                                  'B', 'getInstance'
         12*       DO_FCALL                                      0  $8      
         13*       ASSIGN                                                   !1, $8
   43    14*       INIT_FCALL                                               'var_dump'
         15*       SEND_VAR                                                 !1
         16*       DO_ICALL                                                 
   45    17*       NEW                                              $11     'B'
         18*       DO_FCALL                                      0          
         19*       FREE                                                     $11
   49    20*     > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FlFli5%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFli5
function name:  {closure}
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'var_dump'
          5        FETCH_THIS                                       ~2      
          6        GET_CLASS                                        ~3      ~2
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
    6     9      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FlFli5%3A3%240

Class T:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFli5
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   null

End of function __construct

Function getinstance:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/lFli5
function name:  getInstance
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_STATIC_PROP_R          global lock         ~0      'instanses'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   21     4        FETCH_STATIC_PROP_R          unknown             ~2      'instanses'
          5        INSTANCEOF                                       ~3      ~2
          6        BOOL_NOT                                         ~4      ~3
          7      > JMPZ                                                     ~4, ->12
   22     8    >   NEW                          static              $6      
          9        DO_FCALL                                      0          
         10        ASSIGN_STATIC_PROP                                       'instanses'
         11        OP_DATA                                                  $6
   24    12    >   INIT_FCALL                                               'var_dump'
         13        FETCH_STATIC_PROP_R          unknown             ~8      'instanses'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   25    16        FETCH_STATIC_PROP_R          unknown             ~10     'instanses'
         17      > RETURN                                                   ~10
   26    18*     > RETURN                                                   null

End of function getinstance

End of class T.

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFli5
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   null

End of function __construct

Function getinstance:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/lFli5
function name:  getInstance
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_STATIC_PROP_R          global lock         ~0      'instanses'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   21     4        FETCH_STATIC_PROP_R          unknown             ~2      'instanses'
          5        INSTANCEOF                                       ~3      ~2
          6        BOOL_NOT                                         ~4      ~3
          7      > JMPZ                                                     ~4, ->12
   22     8    >   NEW                          static              $6      
          9        DO_FCALL                                      0          
         10        ASSIGN_STATIC_PROP                                       'instanses'
         11        OP_DATA                                                  $6
   24    12    >   INIT_FCALL                                               'var_dump'
         13        FETCH_STATIC_PROP_R          unknown             ~8      'instanses'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   25    16        FETCH_STATIC_PROP_R          unknown             ~10     'instanses'
         17      > RETURN                                                   ~10
   26    18*     > RETURN                                                   null

End of function getinstance

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFli5
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   null

End of function __construct

Function getinstance:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/lFli5
function name:  getInstance
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_STATIC_PROP_R          global lock         ~0      'instanses'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   21     4        FETCH_STATIC_PROP_R          unknown             ~2      'instanses'
          5        INSTANCEOF                                       ~3      ~2
          6        BOOL_NOT                                         ~4      ~3
          7      > JMPZ                                                     ~4, ->12
   22     8    >   NEW                          static              $6      
          9        DO_FCALL                                      0          
         10        ASSIGN_STATIC_PROP                                       'instanses'
         11        OP_DATA                                                  $6
   24    12    >   INIT_FCALL                                               'var_dump'
         13        FETCH_STATIC_PROP_R          unknown             ~8      'instanses'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   25    16        FETCH_STATIC_PROP_R          unknown             ~10     'instanses'
         17      > RETURN                                                   ~10
   26    18*     > RETURN                                                   null

End of function getinstance

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.08 ms | 1404 KiB | 15 Q