3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "R&ouml;per"; $rest = "R&ouml;per"; $result = "R&ouml;per"; do { $rest = stristr($rest,$s); echo "rest: $rest\n"; $replace = substr($rest,0,strlen($s)); echo "replace: $replace\n"; $result = str_replace($replace,"<span class='textHighlight'>{$replace}</span>",$result); echo "result: $result\n"; $rest = substr($rest,strlen($s)); echo "rest': $rest\n"; } while ($rest !== false); echo $result;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 3
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
filename:       /in/8Xqlc
function name:  (null)
number of ops:  50
compiled vars:  !0 = $s, !1 = $rest, !2 = $result, !3 = $replace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'R%26ouml%3Bper'
    4     1        ASSIGN                                                   !1, 'R%26ouml%3Bper'
    5     2        ASSIGN                                                   !2, 'R%26ouml%3Bper'
    7     3    >   INIT_FCALL                                               'stristr'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !1, $7
    8     8        ROPE_INIT                                     3  ~10     'rest%3A+'
          9        ROPE_ADD                                      1  ~10     ~10, !1
         10        ROPE_END                                      2  ~9      ~10, '%0A'
         11        ECHO                                                     ~9
    9    12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 0
         15        STRLEN                                           ~12     !0
         16        SEND_VAL                                                 ~12
         17        DO_ICALL                                         $13     
         18        ASSIGN                                                   !3, $13
   10    19        ROPE_INIT                                     3  ~16     'replace%3A+'
         20        ROPE_ADD                                      1  ~16     ~16, !3
         21        ROPE_END                                      2  ~15     ~16, '%0A'
         22        ECHO                                                     ~15
   11    23        INIT_FCALL                                               'str_replace'
         24        SEND_VAR                                                 !3
         25        ROPE_INIT                                     3  ~19     '%3Cspan+class%3D%27textHighlight%27%3E'
         26        ROPE_ADD                                      1  ~19     ~19, !3
         27        ROPE_END                                      2  ~18     ~19, '%3C%2Fspan%3E'
         28        SEND_VAL                                                 ~18
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                         $21     
         31        ASSIGN                                                   !2, $21
   12    32        ROPE_INIT                                     3  ~24     'result%3A+'
         33        ROPE_ADD                                      1  ~24     ~24, !2
         34        ROPE_END                                      2  ~23     ~24, '%0A'
         35        ECHO                                                     ~23
   13    36        INIT_FCALL                                               'substr'
         37        SEND_VAR                                                 !1
         38        STRLEN                                           ~26     !0
         39        SEND_VAL                                                 ~26
         40        DO_ICALL                                         $27     
         41        ASSIGN                                                   !1, $27
   14    42        ROPE_INIT                                     3  ~30     'rest%27%3A+'
         43        ROPE_ADD                                      1  ~30     ~30, !1
         44        ROPE_END                                      2  ~29     ~30, '%0A'
         45        ECHO                                                     ~29
   15    46        TYPE_CHECK                                  1018          !1
         47      > JMPNZ                                                    ~32, ->3
   16    48    >   ECHO                                                     !2
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.71 ms | 1400 KiB | 19 Q