3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $foo = 'bar'; public function doFoo(B $b) { echo $b->foo; } } class B extends A { private $foo = 'Class B'; } $a = (new A)->doFoo(new B);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gZHau
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'doFoo'
          3        NEW                                              $3      'B'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $3
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !0, $5
          8      > RETURN                                                   1

Class A:
Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gZHau
function name:  doFoo
number of ops:  4
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_OBJ_R                                      ~1      !0, 'foo'
          2        ECHO                                                     ~1
    7     3      > RETURN                                                   null

End of function dofoo

End of class A.

Class B:
Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gZHau
function name:  doFoo
number of ops:  4
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_OBJ_R                                      ~1      !0, 'foo'
          2        ECHO                                                     ~1
    7     3      > RETURN                                                   null

End of function dofoo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.94 ms | 1394 KiB | 13 Q