3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { protected static $build_keeper = []; public static function build(){ if(!isset(self::$build_keeper[static::class])){ self::$build_keeper[static::class] = new static(); } return self::$build_keeper[static::class]; } protected function __construct() { } } class b extends a { public function doSomeThing() { echo 2; } } class c1 extends a { public function doSomeThingElse() { echo 3; } } b::build()->doSomeThing(); c1::build()->doSomeThingElse();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VAP53
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   INIT_STATIC_METHOD_CALL                                  'b', 'build'
          1        DO_FCALL                                      0  $0      
          2        INIT_METHOD_CALL                                         $0, 'doSomeThing'
          3        DO_FCALL                                      0          
   33     4        INIT_STATIC_METHOD_CALL                                  'c1', 'build'
          5        DO_FCALL                                      0  $2      
          6        INIT_METHOD_CALL                                         $2, 'doSomeThingElse'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class a:
Function build:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/VAP53
function name:  build
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_CLASS_NAME                                 ~1      
          1        FETCH_STATIC_PROP_IS                             ~0      'build_keeper'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~0, ~1
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->11
    8     5    >   FETCH_CLASS_NAME                                 ~5      
          6        NEW                          static              $7      
          7        DO_FCALL                                      0          
          8        FETCH_STATIC_PROP_W          unknown             $4      'build_keeper'
          9        ASSIGN_DIM                                               $4, ~5
         10        OP_DATA                                                  $7
   10    11    >   FETCH_CLASS_NAME                                 ~10     
         12        FETCH_STATIC_PROP_R          unknown             ~9      'build_keeper'
         13        FETCH_DIM_R                                      ~11     ~9, ~10
         14      > RETURN                                                   ~11
   11    15*     > RETURN                                                   null

End of function build

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

End of function __construct

End of class a.

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

End of function dosomething

Function build:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/VAP53
function name:  build
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_CLASS_NAME                                 ~1      
          1        FETCH_STATIC_PROP_IS                             ~0      'build_keeper'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~0, ~1
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->11
    8     5    >   FETCH_CLASS_NAME                                 ~5      
          6        NEW                          static              $7      
          7        DO_FCALL                                      0          
          8        FETCH_STATIC_PROP_W          unknown             $4      'build_keeper'
          9        ASSIGN_DIM                                               $4, ~5
         10        OP_DATA                                                  $7
   10    11    >   FETCH_CLASS_NAME                                 ~10     
         12        FETCH_STATIC_PROP_R          unknown             ~9      'build_keeper'
         13        FETCH_DIM_R                                      ~11     ~9, ~10
         14      > RETURN                                                   ~11
   11    15*     > RETURN                                                   null

End of function build

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

End of function __construct

End of class b.

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

End of function dosomethingelse

Function build:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/VAP53
function name:  build
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_CLASS_NAME                                 ~1      
          1        FETCH_STATIC_PROP_IS                             ~0      'build_keeper'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~0, ~1
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->11
    8     5    >   FETCH_CLASS_NAME                                 ~5      
          6        NEW                          static              $7      
          7        DO_FCALL                                      0          
          8        FETCH_STATIC_PROP_W          unknown             $4      'build_keeper'
          9        ASSIGN_DIM                                               $4, ~5
         10        OP_DATA                                                  $7
   10    11    >   FETCH_CLASS_NAME                                 ~10     
         12        FETCH_STATIC_PROP_R          unknown             ~9      'build_keeper'
         13        FETCH_DIM_R                                      ~11     ~9, ~10
         14      > RETURN                                                   ~11
   11    15*     > RETURN                                                   null

End of function build

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

End of function __construct

End of class c1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
292.13 ms | 1021 KiB | 13 Q