3v4l.org

run code in 300+ PHP versions simultaneously
<?php $searchQuery = "hello"; $dir = "/home/mosh/"; $files = scandir($dir); foreach($files as $file) { if (($file !== ".") && ($file !== "..")) { $s = file_get_contents($file); preg_match("/{$searchQuery}/",$s,$match); if ($match) { $matchedFiles[] = $file; } } } print_r($matchedFiles);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 29
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 29
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 28
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 28
Branch analysis from position: 28
Branch analysis from position: 12
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/qEYgZ
function name:  (null)
number of ops:  34
compiled vars:  !0 = $searchQuery, !1 = $dir, !2 = $files, !3 = $file, !4 = $s, !5 = $match, !6 = $matchedFiles
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'hello'
    3     1        ASSIGN                                                   !1, '%2Fhome%2Fmosh%2F'
    4     2        INIT_FCALL                                               'scandir'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $9      
          5        ASSIGN                                                   !2, $9
    5     6      > FE_RESET_R                                       $11     !2, ->29
          7    > > FE_FETCH_R                                               $11, !3, ->29
    6     8    >   IS_NOT_IDENTICAL                                 ~12     !3, '.'
          9      > JMPZ_EX                                          ~12     ~12, ->12
         10    >   IS_NOT_IDENTICAL                                 ~13     !3, '..'
         11        BOOL                                             ~12     ~13
         12    > > JMPZ                                                     ~12, ->28
    7    13    >   INIT_FCALL                                               'file_get_contents'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                         $14     
         16        ASSIGN                                                   !4, $14
    8    17        INIT_FCALL                                               'preg_match'
         18        ROPE_INIT                                     3  ~17     '%2F'
         19        ROPE_ADD                                      1  ~17     ~17, !0
         20        ROPE_END                                      2  ~16     ~17, '%2F'
         21        SEND_VAL                                                 ~16
         22        SEND_VAR                                                 !4
         23        SEND_REF                                                 !5
         24        DO_ICALL                                                 
    9    25      > JMPZ                                                     !5, ->28
   10    26    >   ASSIGN_DIM                                               !6
         27        OP_DATA                                                  !3
    5    28    > > JMP                                                      ->7
         29    >   FE_FREE                                                  $11
   14    30        INIT_FCALL                                               'print_r'
         31        SEND_VAR                                                 !6
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.66 ms | 1396 KiB | 21 Q