3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { private static $instance; protected $guessers = array(); public static function getInstance() { if (null === self::$instance) { self::$instance = new self(); } return self::$instance; } private function __construct() { $this->guessers[] = new stdClass(); } public function register($guesser) { $this->guessers[] = $guesser; } } class Foo extends Bar { public function __construct() { } } $class = new Foo(); $class->register(new stdClass());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Iak7H
function name:  (null)
number of ops:  9
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   33     3        INIT_METHOD_CALL                                         !0, 'register'
          4        NEW                                              $4      'stdClass'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $4
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class Bar:
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/Iak7H
function name:  getInstance
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'instance'
          1        TYPE_CHECK                                    2          ~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 __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Iak7H
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'stdClass'
          1        DO_FCALL                                      0          
          2        FETCH_OBJ_W                                      $0      'guessers'
          3        ASSIGN_DIM                                               $0
          4        OP_DATA                                                  $2
   17     5      > RETURN                                                   null

End of function __construct

Function register:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Iak7H
function name:  register
number of ops:  5
compiled vars:  !0 = $guesser
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        FETCH_OBJ_W                                      $1      'guessers'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
   21     4      > RETURN                                                   null

End of function register

End of class Bar.

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Iak7H
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     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/Iak7H
function name:  getInstance
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'instance'
          1        TYPE_CHECK                                    2          ~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 register:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Iak7H
function name:  register
number of ops:  5
compiled vars:  !0 = $guesser
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        FETCH_OBJ_W                                      $1      'guessers'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
   21     4      > RETURN                                                   null

End of function register

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.8 ms | 1399 KiB | 13 Q