3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Singletone { private static $instance; private function __construct() { echo 'NEW!'; } public static function getInstance() { if (null !== self::$instance) { self::$instance = new self(); } return self::$instance; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WS0Yu
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                   1

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

End of function getinstance

End of class Singletone.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.07 ms | 1393 KiB | 13 Q