3v4l.org

run code in 300+ PHP versions simultaneously
<?php function &test(): int { $x = 0; try { return $x; } finally { $x = 'test'; } } $x = &test(); var_dump($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BRBW9
function name:  (null)
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN_REF                                               !0, $1
   13     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 7, Position 2 = 4
Branch analysis from position: 7
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 4
Return found
filename:       /in/BRBW9
function name:  test
number of ops:  11
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 0
    6     1        MAKE_REF                                         $3      !0
          2        VERIFY_RETURN_TYPE                                       $3
          3      > FAST_CALL                                                ->7
          4    > > RETURN_BY_REF                                            $3
    7     5*       FAST_CALL                                                ->7
          6*       JMP                                                      ->9
    8     7    >   ASSIGN                                                   !0, 'test'
          8      > FAST_RET                                                 
   10     9*       VERIFY_RETURN_TYPE                                       
         10*     > RETURN_BY_REF                                            null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.13 ms | 1001 KiB | 15 Q