3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "R&ouml;mer"; $rest = "R&ouml;mer"; $result = "R&ouml;mer"; 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); $rest = substr($rest,strlen($s)); } while ($rest !== false); echo $result;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 3
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
filename:       /in/jSktL
function name:  (null)
number of ops:  42
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%3Bmer'
    4     1        ASSIGN                                                   !1, 'R%26ouml%3Bmer'
    5     2        ASSIGN                                                   !2, 'R%26ouml%3Bmer'
    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        INIT_FCALL                                               'substr'
         33        SEND_VAR                                                 !1
         34        STRLEN                                           ~23     !0
         35        SEND_VAL                                                 ~23
         36        DO_ICALL                                         $24     
         37        ASSIGN                                                   !1, $24
   13    38        TYPE_CHECK                                  1018          !1
         39      > JMPNZ                                                    ~26, ->3
   14    40    >   ECHO                                                     !2
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.86 ms | 1396 KiB | 19 Q