3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dna($answer) { switch ( $answer ) { case 56: echo 'Foo'; // fall through default: echo 'Bar'; break; case 42: echo 'Baz'; // fall through case 999: echo '!'; } } dna(42); echo "\n", '---', "\n"; dna(1000);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tirTD
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'dna'
          1        SEND_VAL                                                 42
          2        DO_FCALL                                      0          
   20     3        ECHO                                                     '%0A'
          4        ECHO                                                     '---'
          5        ECHO                                                     '%0A'
   21     6        INIT_FCALL                                               'dna'
          7        SEND_VAL                                                 1000
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function dna:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
filename:       /in/tirTD
function name:  dna
number of ops:  14
compiled vars:  !0 = $answer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        IS_EQUAL                                                 !0, 56
          2      > JMPNZ                                                    ~1, ->8
   11     3    >   IS_EQUAL                                                 !0, 42
          4      > JMPNZ                                                    ~1, ->11
   14     5    >   IS_EQUAL                                                 !0, 999
          6      > JMPNZ                                                    ~1, ->12
          7    > > JMP                                                      ->9
    6     8    >   ECHO                                                     'Foo'
    9     9    >   ECHO                                                     'Bar'
   10    10      > JMP                                                      ->13
   12    11    >   ECHO                                                     'Baz'
   15    12    >   ECHO                                                     '%21'
   17    13    > > RETURN                                                   null

End of function dna

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.61 ms | 1399 KiB | 15 Q