3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = '5'; $result = match($input) { 0 => "hello", '1', '2', '3', '0' => "world", }; echo $result.PHP_EOL; $result = ''; switch ($input) { case 0: $result = "hello"; break; case '1': case '2': case '3': $result = "world"; break; } echo $result.PHP_EOL;
Finding entry points
Branch analysis from position: 0
6 jumps found. (Code = 195) Position 1 = 3, Position 2 = 5, Position 3 = 5, Position 4 = 5, Position 5 = 5, Position 6 = 2
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 20
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
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: 22
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 22
Branch analysis from position: 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 5
Branch analysis from position: 5
Branch analysis from position: 5
Branch analysis from position: 2
1 jumps found. (Code = 197) Position 1 = -2
filename:       /in/RYlUl
function name:  (null)
number of ops:  27
compiled vars:  !0 = $input, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '5'
    4     1      > MATCH                                                    !0, [ 0:->3, '1':->5, '2':->5, '3':->5, '0':->5, ]
          2    > > MATCH_ERROR                                              !0
    5     3    >   QM_ASSIGN                                        ~4      'hello'
          4      > JMP                                                      ->7
    6     5    >   QM_ASSIGN                                        ~4      'world'
          6      > JMP                                                      ->7
    4     7    >   ASSIGN                                                   !1, ~4
    9     8        CONCAT                                           ~6      !1, '%0A'
          9        ECHO                                                     ~6
   10    10        ASSIGN                                                   !1, ''
   12    11        IS_EQUAL                                                 !0, 0
         12      > JMPNZ                                                    ~8, ->20
   15    13    >   IS_EQUAL                                                 !0, '1'
         14      > JMPNZ                                                    ~8, ->22
   16    15    >   IS_EQUAL                                                 !0, '2'
         16      > JMPNZ                                                    ~8, ->22
   17    17    >   IS_EQUAL                                                 !0, '3'
         18      > JMPNZ                                                    ~8, ->22
         19    > > JMP                                                      ->24
   13    20    >   ASSIGN                                                   !1, 'hello'
   14    21      > JMP                                                      ->24
   18    22    >   ASSIGN                                                   !1, 'world'
   19    23      > JMP                                                      ->24
   22    24    >   CONCAT                                           ~11     !1, '%0A'
         25        ECHO                                                     ~11
   23    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.48 ms | 1395 KiB | 13 Q