3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test{ protected static $_instance = NULL; public static function getInstance() { if( ! self::$_instance instanceof self) { self::$_instance = new self; } return self::$_instance; } } test::getInstance(); test::getInstance();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vUgQU
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_STATIC_METHOD_CALL                                  'test', 'getInstance'
          1        DO_FCALL                                      0          
   12     2        INIT_STATIC_METHOD_CALL                                  'test', 'getInstance'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class test:
Function getinstance:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/vUgQU
function name:  getInstance
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      '_instance'
          1        INSTANCEOF                                       ~1      ~0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->8
    6     4    >   NEW                          self                $4      
          5        DO_FCALL                                      0          
          6        ASSIGN_STATIC_PROP                                       '_instance'
          7        OP_DATA                                                  $4
    8     8    >   FETCH_STATIC_PROP_R          unknown             ~6      '_instance'
          9      > RETURN                                                   ~6
    9    10*     > RETURN                                                   null

End of function getinstance

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.32 ms | 1394 KiB | 13 Q