3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url='http://hogedatta.com/';//取得したいURL $html=file_get_contents($url);//htmlをゴソっと取得 mb_language('Japanese');//エンコードエラー対策 $html=mb_convert_encoding($html,'utf8','auto');//文字コードをUTF-8に変換 $html=preg_replace('/(\n|\r)/','',$html);//改行コードを全部消す preg_match_all('@\<div class=\"ranking\"\>(.*?)\<\/div\>@u',$html,$matches);//配列に入れる foreach($matches[0] as $match){ //順位 preg_match('@\<span class=\"num\"\>(.*)位\<\/span\> \<span class=\"product\"\>@u',$match,$num_moto); $num=$num_moto[1]; //商品名 preg_match('@\<span class=\"product\"\>(.*)\<\/span\> \<span class=\"price\"\>@u',$match,$product_moto); $product=$product_moto[1]; //価格 preg_match('@\<span class=\"price\"\>&yen;(.*)\<\/span\>\t\<p class=\"description\"\>@u',$match,$price_moto); $price=$price_moto[1]; //商品詳細 preg_match('@\<p class=\"description\"\>(.*)\<\/p\>\<\/div\>@u',$match,$description_moto); $description=$description_moto[1]; print '順位:'.$num.'<br />'; print '商品名:'.$product.'<br />'; print '価格:'.$price.'<br />'; print '商品詳細:'.$description.'<br /><br />'; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 69
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 69
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 69
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 69
filename:       /in/DnscN
function name:  (null)
number of ops:  71
compiled vars:  !0 = $url, !1 = $html, !2 = $matches, !3 = $match, !4 = $num_moto, !5 = $num, !6 = $product_moto, !7 = $product, !8 = $price_moto, !9 = $price, !10 = $description_moto, !11 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fhogedatta.com%2F'
    4     1        INIT_FCALL                                               'file_get_contents'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $13     
          4        ASSIGN                                                   !1, $13
    5     5        INIT_FCALL                                               'mb_language'
          6        SEND_VAL                                                 'Japanese'
          7        DO_ICALL                                                 
    6     8        INIT_FCALL                                               'mb_convert_encoding'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 'utf8'
         11        SEND_VAL                                                 'auto'
         12        DO_ICALL                                         $16     
         13        ASSIGN                                                   !1, $16
    7    14        INIT_FCALL                                               'preg_replace'
         15        SEND_VAL                                                 '%2F%28%5Cn%7C%5Cr%29%2F'
         16        SEND_VAL                                                 ''
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $18     
         19        ASSIGN                                                   !1, $18
    8    20        INIT_FCALL                                               'preg_match_all'
         21        SEND_VAL                                                 '%40%5C%3Cdiv+class%3D%5C%22ranking%5C%22%5C%3E%28.%2A%3F%29%5C%3C%5C%2Fdiv%5C%3E%40u'
         22        SEND_VAR                                                 !1
         23        SEND_REF                                                 !2
         24        DO_ICALL                                                 
   10    25        FETCH_DIM_R                                      ~21     !2, 0
         26      > FE_RESET_R                                       $22     ~21, ->69
         27    > > FE_FETCH_R                                               $22, !3, ->69
   12    28    >   INIT_FCALL                                               'preg_match'
         29        SEND_VAL                                                 '%40%5C%3Cspan+class%3D%5C%22num%5C%22%5C%3E%28.%2A%29%E4%BD%8D%5C%3C%5C%2Fspan%5C%3E%E3%80%80%5C%3Cspan+class%3D%5C%22product%5C%22%5C%3E%40u'
         30        SEND_VAR                                                 !3
         31        SEND_REF                                                 !4
         32        DO_ICALL                                                 
   13    33        FETCH_DIM_R                                      ~24     !4, 1
         34        ASSIGN                                                   !5, ~24
   16    35        INIT_FCALL                                               'preg_match'
         36        SEND_VAL                                                 '%40%5C%3Cspan+class%3D%5C%22product%5C%22%5C%3E%28.%2A%29%5C%3C%5C%2Fspan%5C%3E%E3%80%80%5C%3Cspan+class%3D%5C%22price%5C%22%5C%3E%40u'
         37        SEND_VAR                                                 !3
         38        SEND_REF                                                 !6
         39        DO_ICALL                                                 
   17    40        FETCH_DIM_R                                      ~27     !6, 1
         41        ASSIGN                                                   !7, ~27
   20    42        INIT_FCALL                                               'preg_match'
         43        SEND_VAL                                                 '%40%5C%3Cspan+class%3D%5C%22price%5C%22%5C%3E%26yen%3B%28.%2A%29%5C%3C%5C%2Fspan%5C%3E%5Ct%5C%3Cp+class%3D%5C%22description%5C%22%5C%3E%40u'
         44        SEND_VAR                                                 !3
         45        SEND_REF                                                 !8
         46        DO_ICALL                                                 
   21    47        FETCH_DIM_R                                      ~30     !8, 1
         48        ASSIGN                                                   !9, ~30
   24    49        INIT_FCALL                                               'preg_match'
         50        SEND_VAL                                                 '%40%5C%3Cp+class%3D%5C%22description%5C%22%5C%3E%28.%2A%29%5C%3C%5C%2Fp%5C%3E%5C%3C%5C%2Fdiv%5C%3E%40u'
         51        SEND_VAR                                                 !3
         52        SEND_REF                                                 !10
         53        DO_ICALL                                                 
   25    54        FETCH_DIM_R                                      ~33     !10, 1
         55        ASSIGN                                                   !11, ~33
   27    56        CONCAT                                           ~35     '%E9%A0%86%E4%BD%8D%EF%BC%9A', !5
         57        CONCAT                                           ~36     ~35, '%3Cbr+%2F%3E'
         58        ECHO                                                     ~36
   28    59        CONCAT                                           ~37     '%E5%95%86%E5%93%81%E5%90%8D%EF%BC%9A', !7
         60        CONCAT                                           ~38     ~37, '%3Cbr+%2F%3E'
         61        ECHO                                                     ~38
   29    62        CONCAT                                           ~39     '%E4%BE%A1%E6%A0%BC%EF%BC%9A', !9
         63        CONCAT                                           ~40     ~39, '%3Cbr+%2F%3E'
         64        ECHO                                                     ~40
   30    65        CONCAT                                           ~41     '%E5%95%86%E5%93%81%E8%A9%B3%E7%B4%B0%EF%BC%9A', !11
         66        CONCAT                                           ~42     ~41, '%3Cbr+%2F%3E%3Cbr+%2F%3E'
         67        ECHO                                                     ~42
   10    68      > JMP                                                      ->27
         69    >   FE_FREE                                                  $22
   32    70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.9 ms | 1405 KiB | 25 Q