3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.42 ms | 1392 KiB | 19 Q