3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { $v = match('float') { 'string' => 's', 'int' => 'i', }; var_dump($v); } catch (UnhandledMatchError $e) { var_dump($e); }
Finding entry points
Branch analysis from position: 0
3 jumps found. (Code = 195) Position 1 = 2, Position 2 = 4, Position 3 = 1
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 1
1 jumps found. (Code = 197) Position 1 = -2
Found catch point at position: 11
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U4Ns2
function name:  (null)
number of ops:  16
compiled vars:  !0 = $v, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > MATCH                                                    'float', [ 'string':->2, 'int':->4, ]
          1    > > MATCH_ERROR                                              'float'
    5     2    >   QM_ASSIGN                                        ~3      's'
          3      > JMP                                                      ->6
    6     4    >   QM_ASSIGN                                        ~3      'i'
          5      > JMP                                                      ->6
    4     6    >   ASSIGN                                                   !0, ~3
    8     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > JMP                                                      ->15
    9    11  E > > CATCH                                       last         'UnhandledMatchError'
   10    12    >   INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   11    15    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.43 ms | 1395 KiB | 15 Q