3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Bienvenue chez nous'; $result = match (true) { preg_match('/Welcome/', $text) || preg_match('/Hello/', $text) => 'en', preg_match('/Bienvenue/', $text) || preg_match('/Bonjour/', $text) => 'fr', default => 'other', }; var_dump($result); $result = match (true) { preg_match('/Welcome/', $text), preg_match('/Hello/', $text) => 'en', preg_match('/Bienvenue/', $text), preg_match('/Bonjour/', $text) => 'fr', default => 'other', }; var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 26
Branch analysis from position: 13
2 jumps found. (Code = 47) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 61
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 61
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 63
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
Branch analysis from position: 63
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
Branch analysis from position: 61
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 23
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 11
filename:       /in/X7fQZ
function name:  (null)
number of ops:  72
compiled vars:  !0 = $text, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Bienvenue+chez+nous'
    6     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2FWelcome%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5      > JMPNZ_EX                                         ~5      $4, ->11
          6    >   INIT_FCALL                                               'preg_match'
          7        SEND_VAL                                                 '%2FHello%2F'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $6      
         10        BOOL                                             ~5      $6
         11    >   IS_IDENTICAL                                             ~5, <true>
         12      > JMPNZ                                                    ~3, ->26
    7    13    >   INIT_FCALL                                               'preg_match'
         14        SEND_VAL                                                 '%2FBienvenue%2F'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $7      
         17      > JMPNZ_EX                                         ~8      $7, ->23
         18    >   INIT_FCALL                                               'preg_match'
         19        SEND_VAL                                                 '%2FBonjour%2F'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $9      
         22        BOOL                                             ~8      $9
         23    >   IS_IDENTICAL                                             ~8, <true>
         24      > JMPNZ                                                    ~3, ->28
         25    > > JMP                                                      ->30
    6    26    >   QM_ASSIGN                                        ~10     'en'
         27      > JMP                                                      ->32
    7    28    >   QM_ASSIGN                                        ~10     'fr'
         29      > JMP                                                      ->32
    8    30    >   QM_ASSIGN                                        ~10     'other'
         31      > JMP                                                      ->32
    5    32    >   ASSIGN                                                   !1, ~10
   11    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !1
         35        DO_ICALL                                                 
   14    36        INIT_FCALL                                               'preg_match'
         37        SEND_VAL                                                 '%2FWelcome%2F'
         38        SEND_VAR                                                 !0
         39        DO_ICALL                                         $14     
         40        IS_IDENTICAL                                             $14, <true>
         41      > JMPNZ                                                    ~13, ->61
         42    >   INIT_FCALL                                               'preg_match'
         43        SEND_VAL                                                 '%2FHello%2F'
         44        SEND_VAR                                                 !0
         45        DO_ICALL                                         $15     
         46        IS_IDENTICAL                                             $15, <true>
         47      > JMPNZ                                                    ~13, ->61
   15    48    >   INIT_FCALL                                               'preg_match'
         49        SEND_VAL                                                 '%2FBienvenue%2F'
         50        SEND_VAR                                                 !0
         51        DO_ICALL                                         $16     
         52        IS_IDENTICAL                                             $16, <true>
         53      > JMPNZ                                                    ~13, ->63
         54    >   INIT_FCALL                                               'preg_match'
         55        SEND_VAL                                                 '%2FBonjour%2F'
         56        SEND_VAR                                                 !0
         57        DO_ICALL                                         $17     
         58        IS_IDENTICAL                                             $17, <true>
         59      > JMPNZ                                                    ~13, ->63
         60    > > JMP                                                      ->65
   14    61    >   QM_ASSIGN                                        ~18     'en'
         62      > JMP                                                      ->67
   15    63    >   QM_ASSIGN                                        ~18     'fr'
         64      > JMP                                                      ->67
   16    65    >   QM_ASSIGN                                        ~18     'other'
         66      > JMP                                                      ->67
   13    67    >   ASSIGN                                                   !1, ~18
   19    68        INIT_FCALL                                               'var_dump'
         69        SEND_VAR                                                 !1
         70        DO_ICALL                                                 
         71      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.54 ms | 1016 KiB | 15 Q