3v4l.org

run code in 300+ PHP versions simultaneously
<?php $paths = [ '/cars$', '.*\/cars$', '^cars\/.*/', '/trucks$', '.*\/trucks$', ]; $paths_string = '#' . implode('|', $paths) . '#'; $current_path = 'cars/honda/'; if (preg_match($paths_string, $current_path)) { echo "it's a match!"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/0L6kq
function name:  (null)
number of ops:  16
compiled vars:  !0 = $paths, !1 = $paths_string, !2 = $current_path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 '%7C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        CONCAT                                           ~5      '%23', $4
          6        CONCAT                                           ~6      ~5, '%23'
          7        ASSIGN                                                   !1, ~6
   12     8        ASSIGN                                                   !2, 'cars%2Fhonda%2F'
   14     9        INIT_FCALL                                               'preg_match'
         10        SEND_VAR                                                 !1
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $9      
         13      > JMPZ                                                     $9, ->15
   15    14    >   ECHO                                                     'it%27s+a+match%21'
   16    15    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.73 ms | 1069 KiB | 15 Q