3v4l.org

run code in 300+ 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 = 29
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 29
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/CYsS7
function name:  (null)
number of ops:  31
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, ->29
          2    > > FE_FETCH_R                                       ~6      $5, !1, ->29
          3    >   ASSIGN                                                   !2, ~6
   15     4        INIT_FCALL                                               'preg_match'
          5        INIT_FCALL                                               'preg_quote'
          6        FETCH_DIM_R                                      ~8      !1, 'index'
          7        SEND_VAL                                                 ~8
          8        SEND_VAL                                                 '%23'
          9        DO_ICALL                                         $9      
         10        CONCAT                                           ~10     '%23%5E%2F%2A', $9
         11        CONCAT                                           ~11     ~10, '%23'
         12        SEND_VAL                                                 ~11
         13        FETCH_DIM_R                                      ~12     !1, 'permalink_structure'
         14        SEND_VAL                                                 ~12
         15        DO_ICALL                                         $13     
         16        ASSIGN                                                   !3, $13
   16    17        ROPE_INIT                                     3  ~16     'preg_match%28%29+with+'
         18        ROPE_ADD                                      1  ~16     ~16, !2
         19        ROPE_END                                      2  ~15     ~16, '%3A+'
         20        ECHO                                                     ~15
         21        TYPE_CHECK                                   16          !3
         22      > JMPZ                                                     ~18, ->25
         23    >   QM_ASSIGN                                        ~19     !3
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~19     'false'
         26    >   ECHO                                                     ~19
         27        ECHO                                                     '%0A'
   14    28      > JMP                                                      ->2
         29    >   FE_FREE                                                  $5
   17    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.71 ms | 1461 KiB | 15 Q