3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.03 ms | 1400 KiB | 17 Q