3v4l.org

run code in 500+ PHP versions simultaneously
<?php //https://www.php.net/manual/en/language.types.type-juggling.php $i = 0; switch($i) { case 'test': echo "1: $i\n"; break 1; } switch((string) $i) { case 'test': echo "2: $i\n"; break 1; } //weird :/ echo '3: ' . ($i == 'test' ? 'true': 'false') . "\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
filename:       /in/if3Z9
function name:  (null)
number of ops:  28
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                       !0, 0
    8     1        IS_EQUAL                                                     !0, 'test'
          2      > JMPNZ                                                        ~2, ->4
          3    > > JMP                                                          ->9
    9     4    >   ROPE_INIT                                         3  ~4      '1%3A+'
          5        ROPE_ADD                                          1  ~4      ~4, !0
          6        ROPE_END                                          2  ~3      ~4, '%0A'
          7        ECHO                                                         ~3
   10     8      > JMP                                                          ->9
   13     9    >   CAST                                              6  ~6      !0
   14    10        CASE                                                         ~6, 'test'
         11      > JMPNZ                                                        ~7, ->13
         12    > > JMP                                                          ->18
   15    13    >   ROPE_INIT                                         3  ~9      '2%3A+'
         14        ROPE_ADD                                          1  ~9      ~9, !0
         15        ROPE_END                                          2  ~8      ~9, '%0A'
         16        ECHO                                                         ~8
   16    17      > JMP                                                          ->18
         18    >   FREE                                                         ~6
   20    19        IS_EQUAL                                                     !0, 'test'
         20      > JMPZ                                                         ~11, ->23
         21    >   QM_ASSIGN                                            ~12     'true'
         22      > JMP                                                          ->24
         23    >   QM_ASSIGN                                            ~12     'false'
         24    >   CONCAT                                               ~13     '3%3A+', ~12
         25        CONCAT                                               ~14     ~13, '%0A'
         26        ECHO                                                         ~14
         27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.45 ms | 3301 KiB | 13 Q