3v4l.org

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

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

End of function f

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.53 ms | 1316 KiB | 14 Q