3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = '/download/asd'; $arrMatch = array(); if (!preg_match('/^\/(\w+)\/.*/', $url, $arrMatch)) { echo $arrMatch[1]; }else{ echo 'NOK'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S7k8p
function name:  (null)
number of ops:  14
compiled vars:  !0 = $url, !1 = $arrMatch
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fdownload%2Fasd'
    5     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%2F%5E%5C%2F%28%5Cw%2B%29%5C%2F.%2A%2F'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !1
          6        DO_ICALL                                         $4      
          7        BOOL_NOT                                         ~5      $4
          8      > JMPZ                                                     ~5, ->12
    7     9    >   FETCH_DIM_R                                      ~6      !1, 1
         10        ECHO                                                     ~6
         11      > JMP                                                      ->13
    9    12    >   ECHO                                                     'NOK'
   10    13    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.56 ms | 1394 KiB | 15 Q