3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lines = file('mytextfile.txt'); $lines = array_slice($lines, 100); $i = 0; foreach($lines as $line) { if(str_contains($line, $keyword)) { echo $line; $i++; if ($i >= 20) { break; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 23
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 23
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 22
Branch analysis from position: 23
Branch analysis from position: 23
filename:       /in/3ONSS
function name:  (null)
number of ops:  25
compiled vars:  !0 = $lines, !1 = $i, !2 = $line, !3 = $keyword
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'file'
          1        SEND_VAL                                                 'mytextfile.txt'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    4     4        INIT_FCALL                                               'array_slice'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 100
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !0, $6
    5     9        ASSIGN                                                   !1, 0
    6    10      > FE_RESET_R                                       $9      !0, ->23
         11    > > FE_FETCH_R                                               $9, !2, ->23
    7    12    >   INIT_FCALL                                               'str_contains'
         13        SEND_VAR                                                 !2
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                         $10     
         16      > JMPZ                                                     $10, ->22
    8    17    >   ECHO                                                     !2
    9    18        PRE_INC                                                  !1
   10    19        IS_SMALLER_OR_EQUAL                                      20, !1
         20      > JMPZ                                                     ~12, ->22
   11    21    > > JMP                                                      ->23
    6    22    > > JMP                                                      ->11
         23    >   FE_FREE                                                  $9
   14    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.3 ms | 1013 KiB | 16 Q