3v4l.org

run code in 300+ PHP versions simultaneously
<?php $searchTerm = "ΓΌ"; $searchTerm2 = "&uuml;"; $replaceTerm = "%FC"; $regex = "/". preg_quote($searchTerm) . '|' . preg_quote($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 = 40, Position 2 = 55
Branch analysis from position: 40
2 jumps found. (Code = 78) Position 1 = 41, Position 2 = 55
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
filename:       /in/Ed3i7
function name:  (null)
number of ops:  58
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        INIT_FCALL                                               'preg_quote'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $12     
         11        CONCAT                                           ~13     ~11, $12
         12        CONCAT                                           ~14     ~13, '%2Fx'
         13        ASSIGN                                                   !3, ~14
    7    14        ROPE_INIT                                     6  ~17     !0
         15        ROPE_ADD                                      1  ~17     ~17, !1
         16        ROPE_ADD                                      2  ~17     ~17, '%2F'
         17        ROPE_ADD                                      3  ~17     ~17, !0
         18        ROPE_ADD                                      4  ~17     ~17, '_.'
         19        ROPE_END                                      5  ~16     ~17, !0
         20        INIT_ARRAY                                       ~20     ~16
         21        NOP                                                      
         22        FAST_CONCAT                                      ~21     'xay', !0
         23        ADD_ARRAY_ELEMENT                                ~20     ~21
         24        ROPE_INIT                                     3  ~23     'asdasd%2F'
         25        ROPE_ADD                                      1  ~23     ~23, !0
         26        ROPE_END                                      2  ~22     ~23, '.mp3'
         27        ADD_ARRAY_ELEMENT                                ~20     ~22
         28        NOP                                                      
         29        FAST_CONCAT                                      ~25     !0, '.'
         30        ADD_ARRAY_ELEMENT                                ~20     ~25
         31        NOP                                                      
         32        FAST_CONCAT                                      ~26     'blahahbasd', !0
         33        ADD_ARRAY_ELEMENT                                ~20     ~26
         34        ROPE_INIT                                     3  ~28     '1234'
         35        ROPE_ADD                                      1  ~28     ~28, !0
         36        ROPE_END                                      2  ~27     ~28, '1234'
         37        ADD_ARRAY_ELEMENT                                ~20     ~27
         38        ASSIGN                                                   !4, ~20
    8    39      > FE_RESET_R                                       $31     !4, ->55
         40    > > FE_FETCH_R                                               $31, !5, ->55
    9    41    >   NOP                                                      
         42        FAST_CONCAT                                      ~32     !5, '+%3D%3E+'
         43        INIT_FCALL                                               'preg_replace'
         44        SEND_VAR                                                 !3
         45        INIT_FCALL                                               'preg_quote'
         46        SEND_VAR                                                 !2
         47        DO_ICALL                                         $33     
         48        SEND_VAR                                                 $33
         49        SEND_VAR                                                 !5
         50        DO_ICALL                                         $34     
         51        CONCAT                                           ~35     ~32, $34
         52        CONCAT                                           ~36     ~35, '%0A'
         53        ECHO                                                     ~36
    8    54      > JMP                                                      ->40
         55    >   FE_FREE                                                  $31
   11    56        ECHO                                                     !3
         57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.5 ms | 1400 KiB | 17 Q