3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php Interface Singleton{public static function instance();} if (class_exists('Singleton')) { $reason = 'class already exists'; } else { class Singleton{ static function getInstance(){ return true; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RBgcu
function name:  (null)
number of ops:  9
compiled vars:  !0 = $reason
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   4     1        INIT_FCALL                                               'class_exists'
         2        SEND_VAL                                                 'Singleton'
         3        DO_ICALL                                         $2      
         4      > JMPZ                                                     $2, ->7
   5     5    >   ASSIGN                                                   !0, 'class+already+exists'
         6      > JMP                                                      ->8
   7     7    >   DECLARE_CLASS                                    $4      'singleton'
  12     8    > > RETURN                                                   1

Class Singleton:
Function instance:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RBgcu
function name:  instance
number of ops:  1
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E > > RETURN                                                   null

End of function instance

End of class Singleton.

Class Singleton:
Function getinstance:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RBgcu
function name:  getInstance
number of ops:  2
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   9     0  E > > RETURN                                                   <true>
  10     1*     > RETURN                                                   null

End of function getinstance

End of class Singleton.

Generated using Vulcan Logic Dumper, using php 7.3.0