3v4l.org

run code in 500+ 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 = 8, Position 2 = 4
Branch analysis from position: 8
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 4
Return found
filename:       /in/BRBW9
function name:  test
number of ops:  12
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                                                    ->8
          4    >   VERIFY_RETURN_TYPE                                           $3
          5      > RETURN_BY_REF                                                $3
    7     6*       FAST_CALL                                                    ->8
          7*       JMP                                                          ->10
    8     8    >   ASSIGN                                                       !0, 'test'
          9      > FAST_RET                                                     
   10    10*       VERIFY_RETURN_TYPE                                           
         11*     > RETURN_BY_REF                                                null

End of function test

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
189.68 ms | 1519 KiB | 15 Q