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<br/>"; $replace = substr($rest,0,strlen($s)); $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 = 36, Position 2 = 3
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
filename:       /in/ptGMO
function name:  (null)
number of ops:  38
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, '%3Cbr%2F%3E'
         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        INIT_FCALL                                               'str_replace'
         20        SEND_VAR                                                 !3
         21        ROPE_INIT                                     3  ~16     '%3Cspan+class%3D%27textHighlight%27%3E'
         22        ROPE_ADD                                      1  ~16     ~16, !3
         23        ROPE_END                                      2  ~15     ~16, '%3C%2Fspan%3E'
         24        SEND_VAL                                                 ~15
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $18     
         27        ASSIGN                                                   !2, $18
   11    28        INIT_FCALL                                               'substr'
         29        SEND_VAR                                                 !1
         30        STRLEN                                           ~20     !0
         31        SEND_VAL                                                 ~20
         32        DO_ICALL                                         $21     
         33        ASSIGN                                                   !1, $21
   12    34        TYPE_CHECK                                  1018          !1
         35      > JMPNZ                                                    ~23, ->3
   13    36    >   ECHO                                                     !2
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.34 ms | 1396 KiB | 19 Q