3v4l.org

run code in 300+ PHP versions simultaneously
<?php // ini_set('max_execution_time', 61200); $path = 'C:/wamp64/www/KMD/verif/SS22 International Range (2000x2000 jpeg)/'; $dir = $path; $allFiles = scandir($dir); // Create CSV output file $chemin = 'csv/photos.csv'; $delimiteur = ';'; $fichier_csv = fopen($chemin, 'w+'); fprintf($fichier_csv, chr(0xEF) . chr(0xBB) . chr(0xBF)); // Get KMD $kmd = []; if (($handle = fopen("KMD.csv", "r")) !== FALSE) { fgets($handle); // skip header line while (($data = fgetcsv($handle, 0, ";")) !== FALSE) { if ($data[0] != null) { $kmd[] = $data[9].'_'.$data[12]; } } fclose($handle); } // Check files foreach($allFiles as $file) { if (!in_array($file, array(".",".."))) { $file = $dir.$file; $filename = basename( $file ); //We delete Online version- $explode = explode("-", $filename); // echo $explode[1]; //14109_NOR_Tauro_Hooded_Jacket_Men_a.jpg $explode2 = explode("_", $explode[1]); $name_picture = $explode2[0].'_'.$explode2[1]; // echo $name_picture; if (! in_array($name_picture, $kmd)) { $resultat = [$name_picture,'Missing image']; print_r($name_file.': Missing image'); echo "<br>"; } else { $resultat = [$name_picture,'Image in folder']; print_r($name_picture.': Image in folder'); echo "<br>"; } fputcsv($fichier_csv, $resultat, $delimiteur); } } fclose($fichier_csv);//close
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 49
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 29
Branch analysis from position: 46
2 jumps found. (Code = 77) Position 1 = 50, Position 2 = 105
Branch analysis from position: 50
2 jumps found. (Code = 78) Position 1 = 51, Position 2 = 105
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 104
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 91
Branch analysis from position: 82
1 jumps found. (Code = 42) Position 1 = 99
Branch analysis from position: 99
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
Branch analysis from position: 91
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
Branch analysis from position: 104
Branch analysis from position: 105
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 105
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 38
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 29
Branch analysis from position: 46
Branch analysis from position: 29
Branch analysis from position: 38
Branch analysis from position: 49
filename:       /in/kJ91t
function name:  (null)
number of ops:  110
compiled vars:  !0 = $path, !1 = $dir, !2 = $allFiles, !3 = $chemin, !4 = $delimiteur, !5 = $fichier_csv, !6 = $kmd, !7 = $handle, !8 = $data, !9 = $file, !10 = $filename, !11 = $explode, !12 = $explode2, !13 = $name_picture, !14 = $resultat, !15 = $name_file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 'C%3A%2Fwamp64%2Fwww%2FKMD%2Fverif%2FSS22+International+Range+%282000x2000+jpeg%29%2F'
    7     1        ASSIGN                                                   !1, !0
    8     2        INIT_FCALL                                               'scandir'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $18     
          5        ASSIGN                                                   !2, $18
   12     6        ASSIGN                                                   !3, 'csv%2Fphotos.csv'
   13     7        ASSIGN                                                   !4, '%3B'
   14     8        INIT_FCALL                                               'fopen'
          9        SEND_VAR                                                 !3
         10        SEND_VAL                                                 'w%2B'
         11        DO_ICALL                                         $22     
         12        ASSIGN                                                   !5, $22
   15    13        INIT_FCALL                                               'fprintf'
         14        SEND_VAR                                                 !5
         15        SEND_VAL                                                 '%EF%BB%BF'
         16        DO_ICALL                                                 
   18    17        ASSIGN                                                   !6, <array>
   19    18        INIT_FCALL                                               'fopen'
         19        SEND_VAL                                                 'KMD.csv'
         20        SEND_VAL                                                 'r'
         21        DO_ICALL                                         $26     
         22        ASSIGN                                           ~27     !7, $26
         23        TYPE_CHECK                                  1018          ~27
         24      > JMPZ                                                     ~28, ->49
   20    25    >   INIT_FCALL                                               'fgets'
         26        SEND_VAR                                                 !7
         27        DO_ICALL                                                 
   21    28      > JMP                                                      ->38
   22    29    >   FETCH_DIM_R                                      ~30     !8, 0
         30        IS_NOT_EQUAL                                             ~30, null
         31      > JMPZ                                                     ~31, ->38
   23    32    >   FETCH_DIM_R                                      ~33     !8, 9
         33        CONCAT                                           ~34     ~33, '_'
         34        FETCH_DIM_R                                      ~35     !8, 12
         35        CONCAT                                           ~36     ~34, ~35
         36        ASSIGN_DIM                                               !6
         37        OP_DATA                                                  ~36
   21    38    >   INIT_FCALL                                               'fgetcsv'
         39        SEND_VAR                                                 !7
         40        SEND_VAL                                                 0
         41        SEND_VAL                                                 '%3B'
         42        DO_ICALL                                         $37     
         43        ASSIGN                                           ~38     !8, $37
         44        TYPE_CHECK                                  1018          ~38
         45      > JMPNZ                                                    ~39, ->29
   26    46    >   INIT_FCALL                                               'fclose'
         47        SEND_VAR                                                 !7
         48        DO_ICALL                                                 
   30    49    > > FE_RESET_R                                       $41     !2, ->105
         50    > > FE_FETCH_R                                               $41, !9, ->105
   32    51    >   IN_ARRAY                                         ~42     !9, <array>
         52        BOOL_NOT                                         ~43     ~42
         53      > JMPZ                                                     ~43, ->104
   34    54    >   CONCAT                                           ~44     !1, !9
         55        ASSIGN                                                   !9, ~44
   35    56        INIT_FCALL                                               'basename'
         57        SEND_VAR                                                 !9
         58        DO_ICALL                                         $46     
         59        ASSIGN                                                   !10, $46
   38    60        INIT_FCALL                                               'explode'
         61        SEND_VAL                                                 '-'
         62        SEND_VAR                                                 !10
         63        DO_ICALL                                         $48     
         64        ASSIGN                                                   !11, $48
   41    65        INIT_FCALL                                               'explode'
         66        SEND_VAL                                                 '_'
         67        FETCH_DIM_R                                      ~50     !11, 1
         68        SEND_VAL                                                 ~50
         69        DO_ICALL                                         $51     
         70        ASSIGN                                                   !12, $51
   42    71        FETCH_DIM_R                                      ~53     !12, 0
         72        CONCAT                                           ~54     ~53, '_'
         73        FETCH_DIM_R                                      ~55     !12, 1
         74        CONCAT                                           ~56     ~54, ~55
         75        ASSIGN                                                   !13, ~56
   45    76        INIT_FCALL                                               'in_array'
         77        SEND_VAR                                                 !13
         78        SEND_VAR                                                 !6
         79        DO_ICALL                                         $58     
         80        BOOL_NOT                                         ~59     $58
         81      > JMPZ                                                     ~59, ->91
   47    82    >   INIT_ARRAY                                       ~60     !13
         83        ADD_ARRAY_ELEMENT                                ~60     'Missing+image'
         84        ASSIGN                                                   !14, ~60
   48    85        INIT_FCALL                                               'print_r'
         86        CONCAT                                           ~62     !15, '%3A+Missing+image'
         87        SEND_VAL                                                 ~62
         88        DO_ICALL                                                 
   49    89        ECHO                                                     '%3Cbr%3E'
   45    90      > JMP                                                      ->99
   53    91    >   INIT_ARRAY                                       ~64     !13
         92        ADD_ARRAY_ELEMENT                                ~64     'Image+in+folder'
         93        ASSIGN                                                   !14, ~64
   54    94        INIT_FCALL                                               'print_r'
         95        CONCAT                                           ~66     !13, '%3A+Image+in+folder'
         96        SEND_VAL                                                 ~66
         97        DO_ICALL                                                 
   55    98        ECHO                                                     '%3Cbr%3E'
   59    99    >   INIT_FCALL                                               'fputcsv'
        100        SEND_VAR                                                 !5
        101        SEND_VAR                                                 !14
        102        SEND_VAR                                                 !4
        103        DO_ICALL                                                 
   30   104    > > JMP                                                      ->50
        105    >   FE_FREE                                                  $41
   63   106        INIT_FCALL                                               'fclose'
        107        SEND_VAR                                                 !5
        108        DO_ICALL                                                 
        109      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.66 ms | 1092 KiB | 24 Q