3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
200.63 ms | 1400 KiB | 19 Q