3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (version_compare(phpversion(), '8.2.0', '<')) { interface Greet { function speak(); } class Hello implements Greet { function speak() { return 'world'; } } } else { interface Greet { function speak(): string; } class Hello implements Greet { function speak(): string { return 'world'; } } } echo (new Hello())->speak();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dZ4OT
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'version_compare'
          1        INIT_FCALL                                               'phpversion'
          2        DO_ICALL                                         $0      
          3        SEND_VAR                                                 $0
          4        SEND_VAL                                                 '8.2.0'
          5        SEND_VAL                                                 '%3C'
          6        DO_ICALL                                         $1      
          7      > JMPZ                                                     $1, ->11
    5     8    >   DECLARE_CLASS                                            'greet'
   10     9        DECLARE_CLASS                                            'hello'
    4    10      > JMP                                                      ->13
   17    11    >   DECLARE_CLASS                                            'greet'
   22    12        DECLARE_CLASS                                            'hello'
   31    13    >   NEW                                              $2      'Hello'
         14        DO_FCALL                                      0          
         15        INIT_METHOD_CALL                                         $2, 'speak'
         16        DO_FCALL                                      0  $4      
         17        ECHO                                                     $4
         18      > RETURN                                                   1

Class Greet:
Function speak:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dZ4OT
function name:  speak
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   null

End of function speak

End of class Greet.

Class Hello:
Function speak:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dZ4OT
function name:  speak
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   'world'
   14     1*     > RETURN                                                   null

End of function speak

End of class Hello.

Class Greet:
Function speak:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dZ4OT
function name:  speak
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   VERIFY_RETURN_TYPE                                       
          1      > RETURN                                                   null

End of function speak

End of class Greet.

Class Hello:
Function speak:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dZ4OT
function name:  speak
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E > > RETURN                                                   'world'
   26     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function speak

End of class Hello.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.31 ms | 1016 KiB | 15 Q