3v4l.org

run code in 500+ PHP versions simultaneously
<?php $datasets = array( 'an index containing "index.php" and the delimiter' => array( 'permalink_structure' => '/index.php', 'index' => 'index.php#', ), 'an index not containing "index.php" and the delimiter' => array( 'permalink_structure' => '/index.php', 'index' => 'somefile.php#', ), ); foreach ( $datasets as $name => $data ) { $result = preg_match( '#^/*' . preg_quote( $data['index'], '#' ) . '#', $data['permalink_structure'] ); echo "preg_match() with $name: ", is_int( $result ) ? $result : 'false', "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 26
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 26
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/CYsS7
function name:  (null)
number of ops:  28
compiled vars:  !0 = $datasets, !1 = $data, !2 = $name, !3 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   14     1      > FE_RESET_R                                           $5      !0, ->26
          2    > > FE_FETCH_R                                           ~6      $5, !1, ->26
          3    >   ASSIGN                                                       !2, ~6
   15     4        INIT_FCALL                                                   'preg_quote'
          5        FETCH_DIM_R                                          ~8      !1, 'index'
          6        SEND_VAL                                                     ~8
          7        SEND_VAL                                                     '%23'
          8        DO_ICALL                                             $9      
          9        CONCAT                                               ~10     '%23%5E%2F%2A', $9
         10        CONCAT                                               ~11     ~10, '%23'
         11        FETCH_DIM_R                                          ~12     !1, 'permalink_structure'
         12        FRAMELESS_ICALL_2                preg_match          ~13     ~11, ~12
         13        ASSIGN                                                       !3, ~13
   16    14        ROPE_INIT                                         3  ~16     'preg_match%28%29+with+'
         15        ROPE_ADD                                          1  ~16     ~16, !2
         16        ROPE_END                                          2  ~15     ~16, '%3A+'
         17        ECHO                                                         ~15
         18        TYPE_CHECK                                       16          !3
         19      > JMPZ                                                         ~18, ->22
         20    >   QM_ASSIGN                                            ~19     !3
         21      > JMP                                                          ->23
         22    >   QM_ASSIGN                                            ~19     'false'
         23    >   ECHO                                                         ~19
         24        ECHO                                                         '%0A'
   14    25      > JMP                                                          ->2
         26    >   FE_FREE                                                      $5
   17    27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.8 ms | 3383 KiB | 14 Q