3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.07 ms | 1405 KiB | 19 Q