3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface IFace{ function doSomething(); } class Foo implements IFace { function doSomething() { return 'OK'; } } abstract class ABar { public $face = null; function __construct(IFace $f) { $this->face = $f; } } class Bar extends ABar { public $face = null; function __construct(IFace $f) { parent::__construct($f); } function run() { print $this->face->doSomething(); } } $bar = new Bar(new Foo()); $bar->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MrTOZ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'foo'
   34     1        NEW                                              $1      'Bar'
          2        NEW                                              $2      'Foo'
          3        DO_FCALL                                      0          
          4        SEND_VAR_NO_REF_EX                                       $2
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $1
   35     7        INIT_METHOD_CALL                                         !0, 'run'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function dosomething

End of class IFace.

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

End of function dosomething

End of class Foo.

Class ABar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MrTOZ
function name:  __construct
number of ops:  4
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        ASSIGN_OBJ                                               'face'
          2        OP_DATA                                                  !0
   18     3      > RETURN                                                   null

End of function __construct

End of class ABar.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MrTOZ
function name:  __construct
number of ops:  5
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   25     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   26     4      > RETURN                                                   null

End of function __construct

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MrTOZ
function name:  run
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~0      'face'
          1        INIT_METHOD_CALL                                         ~0, 'doSomething'
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
   31     4      > RETURN                                                   null

End of function run

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.92 ms | 1399 KiB | 13 Q