3v4l.org

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

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

End of function getinstance

End of class Database.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.15 ms | 1394 KiB | 13 Q