3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $_dependency = ''; public function __construct(string $dependency = '') { if (! empty($dependency)) { $this->_dependency = $dependency; } } public function getDependency() { return $this->_dependency; } } class Bar extends Foo { } $a = new Bar('some dependency'); var_dump($a->getDependency());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JmVFP
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Bar'
          1        SEND_VAL_EX                                              'some+dependency'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   20     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'getDependency'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/JmVFP
function name:  __construct
number of ops:  7
compiled vars:  !0 = $dependency
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      ''
    6     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->6
    7     4    >   ASSIGN_OBJ                                               '_dependency'
          5        OP_DATA                                                  !0
    9     6    > > RETURN                                                   null

End of function __construct

Function getdependency:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JmVFP
function name:  getDependency
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      '_dependency'
          1      > RETURN                                                   ~0
   13     2*     > RETURN                                                   null

End of function getdependency

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/JmVFP
function name:  __construct
number of ops:  7
compiled vars:  !0 = $dependency
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      ''
    6     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->6
    7     4    >   ASSIGN_OBJ                                               '_dependency'
          5        OP_DATA                                                  !0
    9     6    > > RETURN                                                   null

End of function __construct

Function getdependency:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JmVFP
function name:  getDependency
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      '_dependency'
          1      > RETURN                                                   ~0
   13     2*     > RETURN                                                   null

End of function getdependency

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.14 ms | 1400 KiB | 15 Q