3v4l.org

run code in 300+ PHP versions simultaneously
<?php $searchTerm = "ΓΌ"; $searchTerm2 = "&uuml;"; $replaceTerm = "%FC"; $regex = "/". preg_quote($searchTerm) . '|' . $searchTerm2 . "/x"; $test=array("${searchTerm}$searchTerm2/${searchTerm}_.${searchTerm}", "xay${searchTerm}", "asdasd/${searchTerm}.mp3", "${searchTerm}.", "blahahbasd${searchTerm}", "1234${searchTerm}1234"); foreach ($test as $t) echo "$t => " . preg_replace($regex, preg_quote($replaceTerm) , $t) . "\n"; echo $regex;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 52
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 52
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
filename:       /in/GtPcW
function name:  (null)
number of ops:  55
compiled vars:  !0 = $searchTerm, !1 = $searchTerm2, !2 = $replaceTerm, !3 = $regex, !4 = $test, !5 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%C3%BC'
    4     1        ASSIGN                                                   !1, '%26uuml%3B'
    5     2        ASSIGN                                                   !2, '%25FC'
    6     3        INIT_FCALL                                               'preg_quote'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $9      
          6        CONCAT                                           ~10     '%2F', $9
          7        CONCAT                                           ~11     ~10, '%7C'
          8        CONCAT                                           ~12     ~11, !1
          9        CONCAT                                           ~13     ~12, '%2Fx'
         10        ASSIGN                                                   !3, ~13
    7    11        ROPE_INIT                                     6  ~16     !0
         12        ROPE_ADD                                      1  ~16     ~16, !1
         13        ROPE_ADD                                      2  ~16     ~16, '%2F'
         14        ROPE_ADD                                      3  ~16     ~16, !0
         15        ROPE_ADD                                      4  ~16     ~16, '_.'
         16        ROPE_END                                      5  ~15     ~16, !0
         17        INIT_ARRAY                                       ~19     ~15
         18        NOP                                                      
         19        FAST_CONCAT                                      ~20     'xay', !0
         20        ADD_ARRAY_ELEMENT                                ~19     ~20
         21        ROPE_INIT                                     3  ~22     'asdasd%2F'
         22        ROPE_ADD                                      1  ~22     ~22, !0
         23        ROPE_END                                      2  ~21     ~22, '.mp3'
         24        ADD_ARRAY_ELEMENT                                ~19     ~21
         25        NOP                                                      
         26        FAST_CONCAT                                      ~24     !0, '.'
         27        ADD_ARRAY_ELEMENT                                ~19     ~24
         28        NOP                                                      
         29        FAST_CONCAT                                      ~25     'blahahbasd', !0
         30        ADD_ARRAY_ELEMENT                                ~19     ~25
         31        ROPE_INIT                                     3  ~27     '1234'
         32        ROPE_ADD                                      1  ~27     ~27, !0
         33        ROPE_END                                      2  ~26     ~27, '1234'
         34        ADD_ARRAY_ELEMENT                                ~19     ~26
         35        ASSIGN                                                   !4, ~19
    8    36      > FE_RESET_R                                       $30     !4, ->52
         37    > > FE_FETCH_R                                               $30, !5, ->52
    9    38    >   NOP                                                      
         39        FAST_CONCAT                                      ~31     !5, '+%3D%3E+'
         40        INIT_FCALL                                               'preg_replace'
         41        SEND_VAR                                                 !3
         42        INIT_FCALL                                               'preg_quote'
         43        SEND_VAR                                                 !2
         44        DO_ICALL                                         $32     
         45        SEND_VAR                                                 $32
         46        SEND_VAR                                                 !5
         47        DO_ICALL                                         $33     
         48        CONCAT                                           ~34     ~31, $33
         49        CONCAT                                           ~35     ~34, '%0A'
         50        ECHO                                                     ~35
    8    51      > JMP                                                      ->37
         52    >   FE_FREE                                                  $30
   11    53        ECHO                                                     !3
         54      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.75 ms | 1400 KiB | 17 Q