3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Test { public function selfRef(self $other); } class TestImpl implements Test { public function selfRef(self $other) { echo var_export($other, true) . PHP_EOL; } } $a = new TestImpl(); $b = new TestImpl(); $a->selfRef($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RlCA3
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'testimpl'
   18     1        NEW                                              $2      'TestImpl'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   19     4        NEW                                              $5      'TestImpl'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   21     7        INIT_METHOD_CALL                                         !0, 'selfRef'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class Test:
Function selfref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RlCA3
function name:  selfRef
number of ops:  2
compiled vars:  !0 = $other
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function selfref

End of class Test.

Class TestImpl:
Function selfref:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RlCA3
function name:  selfRef
number of ops:  8
compiled vars:  !0 = $other
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        INIT_FCALL                                               'var_export'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $1      
          5        CONCAT                                           ~2      $1, '%0A'
          6        ECHO                                                     ~2
   14     7      > RETURN                                                   null

End of function selfref

End of class TestImpl.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.63 ms | 1387 KiB | 15 Q