3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hello() { return rand(1,3); } switch (hello()) { case 1 : echo 1; break; case 2: echo 2; break; default: echo 3; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
filename:       /in/fmqv2
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'hello'
          1        DO_FCALL                                      0  $0      
    6     2        CASE                                                     $0, 1
          3      > JMPNZ                                                    ~1, ->7
    9     4    >   CASE                                                     $0, 2
          5      > JMPNZ                                                    ~1, ->9
          6    > > JMP                                                      ->11
    7     7    >   ECHO                                                     1
    8     8      > JMP                                                      ->12
   10     9    >   ECHO                                                     2
   11    10      > JMP                                                      ->12
   13    11    >   ECHO                                                     3
         12    >   FREE                                                     $0
   14    13      > RETURN                                                   1

Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fmqv2
function name:  hello
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'rand'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 3
          3        DO_ICALL                                         $0      
          4      > RETURN                                                   $0
    4     5*     > RETURN                                                   null

End of function hello

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.53 ms | 1398 KiB | 16 Q