3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types = 1); function f(): int { if (true) goto a; if (random_int(0,1)) return 2; return 1; if (true) { a: return 2; } } var_dump(f());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B8rMi
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'f'
          2        DO_FCALL                                          0  $0      
          3        SEND_VAR                                                     $0
          4        DO_ICALL                                                     
          5      > RETURN                                                       1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 2
Branch analysis from position: 1
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B8rMi
function name:  f
number of ops:  13
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E > > JMPZ                                                         <true>, ->2
    5     1    > > JMP                                                          ->10
    6     2    >   INIT_FCALL                                                   'random_int'
          3        SEND_VAL                                                     0
          4        SEND_VAL                                                     1
          5        DO_ICALL                                             $0      
          6      > JMPZ                                                         $0, ->8
    7     7    > > RETURN                                                       2
    8     8    > > RETURN                                                       1
   10     9*       JMPZ                                                         <true>, ->11
   12    10    > > RETURN                                                       2
   15    11*       VERIFY_RETURN_TYPE                                           
         12*     > RETURN                                                       null

End of function f

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.49 ms | 1321 KiB | 16 Q