3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function saySomething() { return 'Hello!'; } } class ProxyFoo extends Foo {} function foobar(Foo $foo) { echo $foo->saySomething(); } class FooHolder { public Foo $foo; public function __construct(Foo $foo) { $this->foo = $foo; } public function echo() { echo $this->foo->saySomething(); } } $foo = new ProxyFoo(); foobar($foo); $fooHolder = new FooHolder($foo); $fooHolder->echo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8R1vD
function name:  (null)
number of ops:  13
compiled vars:  !0 = $foo, !1 = $fooHolder
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $2      'ProxyFoo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   29     3        INIT_FCALL                                               'foobar'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0          
   31     6        NEW                                              $6      'FooHolder'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $6
   32    10        INIT_METHOD_CALL                                         !1, 'echo'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function foobar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8R1vD
function name:  foobar
number of ops:  5
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_METHOD_CALL                                         !0, 'saySomething'
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
   13     4      > RETURN                                                   null

End of function foobar

Class Foo:
Function saysomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8R1vD
function name:  saySomething
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'Hello%21'
    6     1*     > RETURN                                                   null

End of function saysomething

End of class Foo.

Class ProxyFoo:
Function saysomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8R1vD
function name:  saySomething
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'Hello%21'
    6     1*     > RETURN                                                   null

End of function saysomething

End of class ProxyFoo.

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

End of function __construct

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

End of function echo

End of class FooHolder.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.38 ms | 950 KiB | 14 Q