3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class T { final private function __construct(){ } public static function getInstance() { if (!isset(static::$instanses)) { static::$instanses = new $this; } return static::$instanses; } } class A extends T { } $t = A::getInstance(); var_dump($t); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kAGdT
function name:  (null)
number of ops:  7
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'getInstance'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   25     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   29     6      > RETURN                                                   1

Class T:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kAGdT
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     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 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/kAGdT
function name:  getInstance
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ISSET_ISEMPTY_STATIC_PROP                        ~0      'instanses'
          1        BOOL_NOT                                         ~1      ~0
          2      > JMPZ                                                     ~1, ->9
   13     3    >   FETCH_THIS                                       ~3      
          4        FETCH_CLASS                                   0  $4      ~3
          5        NEW                                              $5      $4
          6        DO_FCALL                                      0          
          7        ASSIGN_STATIC_PROP                                       'instanses'
          8        OP_DATA                                                  $5
   16     9    >   FETCH_STATIC_PROP_R          unknown             ~7      'instanses'
         10      > RETURN                                                   ~7
   17    11*     > 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/kAGdT
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     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 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/kAGdT
function name:  getInstance
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ISSET_ISEMPTY_STATIC_PROP                        ~0      'instanses'
          1        BOOL_NOT                                         ~1      ~0
          2      > JMPZ                                                     ~1, ->9
   13     3    >   FETCH_THIS                                       ~3      
          4        FETCH_CLASS                                   0  $4      ~3
          5        NEW                                              $5      $4
          6        DO_FCALL                                      0          
          7        ASSIGN_STATIC_PROP                                       'instanses'
          8        OP_DATA                                                  $5
   16     9    >   FETCH_STATIC_PROP_R          unknown             ~7      'instanses'
         10      > RETURN                                                   ~7
   17    11*     > RETURN                                                   null

End of function getinstance

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.1 ms | 1400 KiB | 15 Q