3v4l.org

run code in 300+ PHP versions simultaneously
<?php const SomeInterface = 1; const AnotherInterface = 2; $object = AnotherInterface; var_dump( match ($object) { SomeInterface => 'foo', AnotherInterface => 'bar', } );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 197) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
filename:       /in/BEcE4
function name:  (null)
number of ops:  20
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'SomeInterface', 1
    4     1        DECLARE_CONST                                            'AnotherInterface', 2
    5     2        FETCH_CONSTANT                                   ~1      'AnotherInterface'
          3        ASSIGN                                                   !0, ~1
    7     4        INIT_FCALL                                               'var_dump'
    9     5        FETCH_CONSTANT                                   ~4      'SomeInterface'
          6        IS_IDENTICAL                                             !0, ~4
          7      > JMPNZ                                                    ~3, ->13
   10     8    >   FETCH_CONSTANT                                   ~5      'AnotherInterface'
          9        IS_IDENTICAL                                             !0, ~5
         10      > JMPNZ                                                    ~3, ->15
         11    > > JMP                                                      ->12
         12    > > MATCH_ERROR                                              !0
    9    13    >   QM_ASSIGN                                        ~6      'foo'
         14      > JMP                                                      ->17
   10    15    >   QM_ASSIGN                                        ~6      'bar'
         16      > JMP                                                      ->17
         17    >   SEND_VAL                                                 ~6
         18        DO_ICALL                                                 
   12    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.94 ms | 1395 KiB | 15 Q