3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$string = "-Lorem Ipsum"; // 1 //$string = "--Lorem Ipsum"; // 2 $string = "---Lorem Ipsum"; // 3 //$string = "--Lorem-Ipsum"; // 2 $search="-"; $i=0; while($string[$i]==$search) { $i++; } echo "Found $i instances at the start of the string.";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
Branch analysis from position: 4
filename:       /in/LSW2J
function name:  (null)
number of ops:  13
compiled vars:  !0 = $string, !1 = $search, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '---Lorem+Ipsum'
    8     1        ASSIGN                                                   !1, '-'
    9     2        ASSIGN                                                   !2, 0
   10     3      > JMP                                                      ->5
   12     4    >   PRE_INC                                                  !2
   10     5    >   FETCH_DIM_R                                      ~7      !0, !2
          6        IS_EQUAL                                                 !1, ~7
          7      > JMPNZ                                                    ~8, ->4
   14     8    >   ROPE_INIT                                     3  ~10     'Found+'
          9        ROPE_ADD                                      1  ~10     ~10, !2
         10        ROPE_END                                      2  ~9      ~10, '+instances+at+the+start+of+the+string.'
         11        ECHO                                                     ~9
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.51 ms | 1393 KiB | 13 Q