3v4l.org

run code in 300+ PHP versions simultaneously
<?php $permalink_structure = '/index2php/converter/%post_id%/'; $index = 'index.php'; $without_preg_quote = preg_match( '#^/*' . $index . '#', $permalink_structure ); $with_preg_quote = preg_match( '#^/*' . preg_quote( $index, '#' ) . '#', $permalink_structure ); echo 'Without preg_quote(): ', var_export( $without_preg_quote, true ), "\n"; echo 'With preg_quote(): ', var_export( $with_preg_quote, true ), "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LQSOG
function name:  (null)
number of ops:  35
compiled vars:  !0 = $permalink_structure, !1 = $index, !2 = $without_preg_quote, !3 = $with_preg_quote
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Findex2php%2Fconverter%2F%25post_id%25%2F'
    4     1        ASSIGN                                                   !1, 'index.php'
    5     2        INIT_FCALL                                               'preg_match'
          3        CONCAT                                           ~6      '%23%5E%2F%2A', !1
          4        CONCAT                                           ~7      ~6, '%23'
          5        SEND_VAL                                                 ~7
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !2, $8
    6     9        INIT_FCALL                                               'preg_match'
         10        INIT_FCALL                                               'preg_quote'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 '%23'
         13        DO_ICALL                                         $10     
         14        CONCAT                                           ~11     '%23%5E%2F%2A', $10
         15        CONCAT                                           ~12     ~11, '%23'
         16        SEND_VAL                                                 ~12
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $13     
         19        ASSIGN                                                   !3, $13
    8    20        ECHO                                                     'Without+preg_quote%28%29%3A+'
         21        INIT_FCALL                                               'var_export'
         22        SEND_VAR                                                 !2
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $15     
         25        ECHO                                                     $15
         26        ECHO                                                     '%0A'
    9    27        ECHO                                                     'With+preg_quote%28%29%3A+'
         28        INIT_FCALL                                               'var_export'
         29        SEND_VAR                                                 !3
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $16     
         32        ECHO                                                     $16
         33        ECHO                                                     '%0A'
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.13 ms | 1003 KiB | 16 Q