3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startWord = ':begin'; $endWord = 'sqlexception'; // Open the SQL file for reading $foundStart = false; $x = 0; $d = array('a', 'b', 'c', ':begin', 'd', 'e', ':begin', 'more', 'sqlexception'); foreach($d as $line) { if ($foundStart || stripos($line, $startWord) !== false) { $foundStart = true; echo $line; // Display the current line if (stripos($line, $endWord) !== false) { $foundStart = false; // Stop displaying lines after finding the end word } } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 25
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 25
Branch analysis from position: 7
2 jumps found. (Code = 47) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 24
Branch analysis from position: 24
Branch analysis from position: 14
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/EO7Qn
function name:  (null)
number of ops:  27
compiled vars:  !0 = $startWord, !1 = $endWord, !2 = $foundStart, !3 = $x, !4 = $d, !5 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Abegin'
    3     1        ASSIGN                                                   !1, 'sqlexception'
    5     2        ASSIGN                                                   !2, <false>
    6     3        ASSIGN                                                   !3, 0
    7     4        ASSIGN                                                   !4, <array>
    8     5      > FE_RESET_R                                       $11     !4, ->25
          6    > > FE_FETCH_R                                               $11, !5, ->25
    9     7    > > JMPNZ_EX                                         ~12     !2, ->14
          8    >   INIT_FCALL                                               'stripos'
          9        SEND_VAR                                                 !5
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $13     
         12        TYPE_CHECK                                  1018  ~14     $13
         13        BOOL                                             ~12     ~14
         14    > > JMPZ                                                     ~12, ->24
   10    15    >   ASSIGN                                                   !2, <true>
   11    16        ECHO                                                     !5
   12    17        INIT_FCALL                                               'stripos'
         18        SEND_VAR                                                 !5
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $16     
         21        TYPE_CHECK                                  1018          $16
         22      > JMPZ                                                     ~17, ->24
   13    23    >   ASSIGN                                                   !2, <false>
    8    24    > > JMP                                                      ->6
         25    >   FE_FREE                                                  $11
   17    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.46 ms | 1011 KiB | 14 Q