3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function foo(self $that) { var_dump($that); } } class B extends A { } $a = new A(); $a->foo($a); $b = new B(); $b->foo($a); $b->foo($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S00I6
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
   18     6        NEW                                              $6      'B'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   19     9        INIT_METHOD_CALL                                         !1, 'foo'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
   20    12        INIT_METHOD_CALL                                         !1, 'foo'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

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

End of function foo

End of class A.

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

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.05 ms | 1396 KiB | 15 Q