3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.96 ms | 1400 KiB | 19 Q