3v4l.org

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

Class Foo:
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/TW6N7
function name:  getInstance
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ISSET_ISEMPTY_STATIC_PROP                        ~0      '_instance'
          1        BOOL_NOT                                         ~1      ~0
          2      > JMPZ                                                     ~1, ->7
   10     3    >   NEW                          self                $3      
          4        DO_FCALL                                      0          
          5        ASSIGN_STATIC_PROP                                       '_instance'
          6        OP_DATA                                                  $3
   12     7    >   FETCH_STATIC_PROP_R          unknown             ~5      '_instance'
          8      > RETURN                                                   ~5
   13     9*     > RETURN                                                   null

End of function getinstance

Function dobar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TW6N7
function name:  doBar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ECHO                                                     'Baz'
   18     1      > RETURN                                                   null

End of function dobar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.77 ms | 1385 KiB | 13 Q