3v4l.org

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

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

End of function getinstance

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.46 ms | 1395 KiB | 15 Q