3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function hello(): string { return "Hello World!"; } } class Test2 { public function hello(): string { return "Test2 Hello World!"; } } function bla(): Test { return new Test2(); } $test = bla(); echo $test->hello();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bsNSR
function name:  (null)
number of ops:  7
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'bla'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'hello'
          4        DO_FCALL                                      0  $3      
          5        ECHO                                                     $3
          6      > RETURN                                                   1

Function bla:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bsNSR
function name:  bla
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $0      'Test2'
          1        DO_FCALL                                      0          
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   17     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function bla

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

End of function hello

End of class Test.

Class Test2:
Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bsNSR
function name:  hello
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'Test2+Hello+World%21'
   12     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function hello

End of class Test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.18 ms | 1403 KiB | 14 Q