3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(E_ALL); interface bar { public function test(): string|null; } class foo implements bar { public function test(): string { echo "return __CLASS__" . PHP_EOL; return __CLASS__; } } class foobar extends foo { public function test(): never { echo "exit 0" . PHP_EOL; exit(0); } } (new foo())->test(); (new foobar())->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8shXL
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'error_reporting'
          1        SEND_VAL                                                     30719
          2        DO_ICALL                                                     
    9     3        DECLARE_CLASS                                                'foo'
   17     4        DECLARE_CLASS                                                'foobar', 'foo'
   27     5        NEW                                                  $1      'foo'
          6        DO_FCALL                                          0          
          7        INIT_METHOD_CALL                                             $1, 'test'
          8        DO_FCALL                                          0          
   28     9        NEW                                                  $4      'foobar'
         10        DO_FCALL                                          0          
         11        INIT_METHOD_CALL                                             $4, 'test'
         12        DO_FCALL                                          0          
         13      > RETURN                                                       1

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

End of function test

End of class bar.

Class foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8shXL
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                         'return+__CLASS__%0A'
   13     1      > RETURN                                                       'foo'
   14     2*       VERIFY_RETURN_TYPE                                           
          3*     > RETURN                                                       null

End of function test

End of class foo.

Class foobar:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 61) Position 1 = -2
filename:       /in/8shXL
function name:  test
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   ECHO                                                         'exit+0%0A'
   21     1      > INIT_FCALL                                                   'exit'
          2*       SEND_VAL                                                     0
          3*       DO_ICALL                                                     
   22     4*     > VERIFY_NEVER_TYPE                                            

End of function test

End of class foobar.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.13 ms | 488 KiB | 12 Q