3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '\n;alskdjf;lkdsajf;lkjdsaf \n hey judeee \n'; $pattern = '\n'; $start = 0; while(($newLine = strpos($string, $pattern, $start)) !== false){ $start = $newLine + 1; echo $newLine . '<br>'; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
Branch analysis from position: 4
filename:       /in/p2KdJ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $string, !1 = $pattern, !2 = $start, !3 = $newLine
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5Cn%3Balskdjf%3Blkdsajf%3Blkjdsaf+%5Cn+hey+judeee+%5Cn'
    3     1        ASSIGN                                                   !1, '%5Cn'
    4     2        ASSIGN                                                   !2, 0
    5     3      > JMP                                                      ->8
    6     4    >   ADD                                              ~7      !3, 1
          5        ASSIGN                                                   !2, ~7
    7     6        CONCAT                                           ~9      !3, '%3Cbr%3E'
          7        ECHO                                                     ~9
    5     8    >   INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $10     
         13        ASSIGN                                           ~11     !3, $10
         14        TYPE_CHECK                                  1018          ~11
         15      > JMPNZ                                                    ~12, ->4
    8    16    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.37 ms | 1395 KiB | 15 Q