3v4l.org

run code in 300+ PHP versions simultaneously
<?php $HTTP_USER_AGENT = "afeaetest2asdf"; $INSTALLED_STYLES = array("desktop","mobile","topifySeo"); $seo_agents = "test1,test2,test3"; $custom1agents = str_replace(",","|",$seo_agents);//explode(",",$seo_agents); echo implode('|', $custom1agents); if(preg_match('/('.implode('|', $custom1agents).')/i', $HTTP_USER_AGENT, $match)) { echo "matched"; } else { echo "did not match"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cIlS6
function name:  (null)
number of ops:  30
compiled vars:  !0 = $HTTP_USER_AGENT, !1 = $INSTALLED_STYLES, !2 = $seo_agents, !3 = $custom1agents, !4 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'afeaetest2asdf'
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, 'test1%2Ctest2%2Ctest3'
    5     3        INIT_FCALL                                               'str_replace'
          4        SEND_VAL                                                 '%2C'
          5        SEND_VAL                                                 '%7C'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !3, $8
    6     9        INIT_FCALL                                               'implode'
         10        SEND_VAL                                                 '%7C'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $10     
         13        ECHO                                                     $10
    8    14        INIT_FCALL                                               'preg_match'
         15        INIT_FCALL                                               'implode'
         16        SEND_VAL                                                 '%7C'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $11     
         19        CONCAT                                           ~12     '%2F%28', $11
         20        CONCAT                                           ~13     ~12, '%29%2Fi'
         21        SEND_VAL                                                 ~13
         22        SEND_VAR                                                 !0
         23        SEND_REF                                                 !4
         24        DO_ICALL                                         $14     
         25      > JMPZ                                                     $14, ->28
   10    26    >   ECHO                                                     'matched'
         27      > JMP                                                      ->29
   14    28    >   ECHO                                                     'did+not+match'
   15    29    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.66 ms | 1396 KiB | 19 Q