3v4l.org

run code in 300+ PHP versions simultaneously
<? // Make array of URLs to work with $URLs = array( 'http://zonzoo.nl/uw-telefoons-verkopen/1023/Apple+iPhone+4+16GB', 'http://zonzoo.nl/uw-telefoons-verkopen/1024/Apple+iPhone+4+32GB', 'http://zonzoo.nl/uw-telefoons-verkopen/1272/Apple+iPhone+4+8GB' ); // Loop through each array and store the prices in arrays foreach ($URLs as $URL) { $working[] = do_shortcode('[wpwg url="' . $URL . '" selector=".price-quote.working dd" cache="0" rem_tags="script, style" newtab="false"]'); $not_working[] = do_shortcode('[wpwg url="' . $URL . '" selector=".price-quote.not_working dd" cache="0" rem_tags="script, style" newtab="false"]'); } // Open the file "zonzoo.csv" for writing $file = fopen('zonzoo.csv', 'w'); // Save the column headers fputcsv($file, array('ID', 'NAME', 'CATEGORY', 'BRAND', 'PRICE', 'DEEPLINK', 'IMAGE', 'SHIPPING')); // Sample data. This can be fetched from MySQL too $data = array ( array(1, 'iPhone 4 16GB', 'Mobiel', 'Apple', 0, 'http://zonzoo.nl/uw-telefoons-verkopen/1023/Apple+iPhone+4+16GB', 'http://www.fonebank.com/images/uploads/handsets/apple-iphone-4-ofic-final.jpg', 0), array(2, 'iPhone 4 32GB', 'Mobiel', 'Apple', 0, 'http://zonzoo.nl/uw-telefoons-verkopen/1024/Apple+iPhone+4+32GB', 'http://www.fonebank.com/images/uploads/handsets/apple-iphone-4-ofic-final.jpg', 0), array(3, 'iPhone 4 8GB', 'Mobiel', 'Apple', 0, 'http://zonzoo.nl/uw-telefoons-verkopen/1272/Apple+iPhone+4+8GB', 'http://www.fonebank.com/images/uploads/handsets/apple-iphone-4-ofic-final.jpg', 0) ); // Replace the prices of working mobile phones $i = 0; foreach ($working as $price_working) { $data[$i][4] = $price_working; $i++; } // Replace the prices of not-working mobile phones $x = 0; foreach ($not_working as $price_not_working) { $data[$x][7] = $price_not_working; $x++; } // Save each row of the data foreach ($data as $row) { fputcsv($file, $row); } // Close the file fclose($file); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 18
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 37
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 37
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 37
2 jumps found. (Code = 77) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
2 jumps found. (Code = 78) Position 1 = 41, Position 2 = 46
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 46
2 jumps found. (Code = 77) Position 1 = 48, Position 2 = 54
Branch analysis from position: 48
2 jumps found. (Code = 78) Position 1 = 49, Position 2 = 54
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
Branch analysis from position: 46
Branch analysis from position: 37
Branch analysis from position: 18
filename:       /in/KhPNM
function name:  (null)
number of ops:  59
compiled vars:  !0 = $URLs, !1 = $URL, !2 = $working, !3 = $not_working, !4 = $file, !5 = $data, !6 = $i, !7 = $price_working, !8 = $x, !9 = $price_not_working, !10 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   11     1      > FE_RESET_R                                       $12     !0, ->18
          2    > > FE_FETCH_R                                               $12, !1, ->18
   12     3    >   INIT_FCALL_BY_NAME                                       'do_shortcode'
          4        CONCAT                                           ~14     '%5Bwpwg+url%3D%22', !1
          5        CONCAT                                           ~15     ~14, '%22+selector%3D%22.price-quote.working+dd%22+cache%3D%220%22+rem_tags%3D%22script%2C+style%22+newtab%3D%22false%22%5D'
          6        SEND_VAL_EX                                              ~15
          7        DO_FCALL                                      0  $16     
          8        ASSIGN_DIM                                               !2
          9        OP_DATA                                                  $16
   13    10        INIT_FCALL_BY_NAME                                       'do_shortcode'
         11        CONCAT                                           ~18     '%5Bwpwg+url%3D%22', !1
         12        CONCAT                                           ~19     ~18, '%22+selector%3D%22.price-quote.not_working+dd%22+cache%3D%220%22+rem_tags%3D%22script%2C+style%22+newtab%3D%22false%22%5D'
         13        SEND_VAL_EX                                              ~19
         14        DO_FCALL                                      0  $20     
         15        ASSIGN_DIM                                               !3
         16        OP_DATA                                                  $20
   11    17      > JMP                                                      ->2
         18    >   FE_FREE                                                  $12
   17    19        INIT_FCALL                                               'fopen'
         20        SEND_VAL                                                 'zonzoo.csv'
         21        SEND_VAL                                                 'w'
         22        DO_ICALL                                         $21     
         23        ASSIGN                                                   !4, $21
   20    24        INIT_FCALL                                               'fputcsv'
         25        SEND_VAR                                                 !4
         26        SEND_VAL                                                 <array>
         27        DO_ICALL                                                 
   23    28        ASSIGN                                                   !5, <array>
   31    29        ASSIGN                                                   !6, 0
   32    30      > FE_RESET_R                                       $26     !2, ->37
         31    > > FE_FETCH_R                                               $26, !7, ->37
   33    32    >   FETCH_DIM_W                                      $27     !5, !6
         33        ASSIGN_DIM                                               $27, 4
         34        OP_DATA                                                  !7
   34    35        PRE_INC                                                  !6
   32    36      > JMP                                                      ->31
         37    >   FE_FREE                                                  $26
   38    38        ASSIGN                                                   !8, 0
   39    39      > FE_RESET_R                                       $31     !3, ->46
         40    > > FE_FETCH_R                                               $31, !9, ->46
   40    41    >   FETCH_DIM_W                                      $32     !5, !8
         42        ASSIGN_DIM                                               $32, 7
         43        OP_DATA                                                  !9
   41    44        PRE_INC                                                  !8
   39    45      > JMP                                                      ->40
         46    >   FE_FREE                                                  $31
   45    47      > FE_RESET_R                                       $35     !5, ->54
         48    > > FE_FETCH_R                                               $35, !10, ->54
   46    49    >   INIT_FCALL                                               'fputcsv'
         50        SEND_VAR                                                 !4
         51        SEND_VAR                                                 !10
         52        DO_ICALL                                                 
   45    53      > JMP                                                      ->48
         54    >   FE_FREE                                                  $35
   50    55        INIT_FCALL                                               'fclose'
         56        SEND_VAR                                                 !4
         57        DO_ICALL                                                 
   52    58      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.58 ms | 1400 KiB | 19 Q