3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Database { private static $database; private function __construct() { // Nothing } public static function getInstance() { if (!self::$database) { self::$database = new Database(); } return self::$database; } } class BasicMath { public function getString($string) { return $string; } public static function add($number1, $number2) { $this->getString('hEllo'); return $number1 + $number2; } } var_dump(BasicMath::add(1, 2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PBg0b
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'BasicMath', 'add'
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 2
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

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

End of function getinstance

End of class Database.

Class BasicMath:
Function getstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PBg0b
function name:  getString
number of ops:  3
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   25     1      > RETURN                                                   !0
   26     2*     > RETURN                                                   null

End of function getstring

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PBg0b
function name:  add
number of ops:  9
compiled vars:  !0 = $number1, !1 = $number2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   30     2        FETCH_THIS                                       $2      
          3        INIT_METHOD_CALL                                         $2, 'getString'
          4        SEND_VAL_EX                                              'hEllo'
          5        DO_FCALL                                      0          
   31     6        ADD                                              ~4      !0, !1
          7      > RETURN                                                   ~4
   32     8*     > RETURN                                                   null

End of function add

End of class BasicMath.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.07 ms | 1400 KiB | 15 Q