3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url="http://www.mobiflip.de/xperia-play-china-geraete-konzept/"; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_TIMEOUT, 3); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, false); // FeedBurner requires a proper USER-AGENT... curl_setopt($curl, CURL_HTTP_VERSION_1_1, true); curl_setopt($curl, CURLOPT_ENCODING, "gzip, deflate"); curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3"); $content = curl_exec($curl); $content = substr($content,strpos($content,"<body>")); // $content = substr($content,strpos($content,$n->title)); //echo $content; preg_match_all('@src=[\'"](?:http(?:s)*:)*(?://)*(?P<src>[a-zA-Z0-9/_\-\.]+(jpg|png|gif|jpeg|tif))[\'"\?%]@i', $content, $image); //$c = new DOMDocument(); //@$c->loadXML($content); //var_dump($c->getElementsByTagName('img'));//->item(0)->getAttribute('src'); //$xml=simplexml_load_string($content); //print_r($xml); //return; $actPic = new stdClass(); $actPic->size=0; $actPic->url=null; foreach($image['src'] as $pic){ try{ $pic="http://".$pic; $sz=getimagesize($pic); echo "<br>".$pic.":";var_dump($sz);echo "<br>"; if( $sz && $sz[0]>400 && $sz[0]*$sz[1] > $actPic->size ){ $actPic->size=$sz[0]*$sz[1]; $actPic->url=$pic; } }catch(Exception $e){ Debugbar::addError($e); } } echo "<img src='".$actPic->url."'><br>"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 79, Position 2 = 118
Branch analysis from position: 79
2 jumps found. (Code = 78) Position 1 = 80, Position 2 = 118
Branch analysis from position: 80
2 jumps found. (Code = 46) Position 1 = 94, Position 2 = 97
Branch analysis from position: 94
2 jumps found. (Code = 46) Position 1 = 98, Position 2 = 104
Branch analysis from position: 98
2 jumps found. (Code = 43) Position 1 = 105, Position 2 = 112
Branch analysis from position: 105
1 jumps found. (Code = 42) Position 1 = 117
Branch analysis from position: 117
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
Branch analysis from position: 112
Branch analysis from position: 104
Branch analysis from position: 97
Branch analysis from position: 118
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 118
Found catch point at position: 113
Branch analysis from position: 113
2 jumps found. (Code = 107) Position 1 = 114, Position 2 = -2
Branch analysis from position: 114
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
filename:       /in/KJafT
function name:  (null)
number of ops:  124
compiled vars:  !0 = $url, !1 = $curl, !2 = $content, !3 = $image, !4 = $actPic, !5 = $pic, !6 = $sz, !7 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fwww.mobiflip.de%2Fxperia-play-china-geraete-konzept%2F'
    6     1        INIT_FCALL_BY_NAME                                       'curl_init'
          2        DO_FCALL                                      0  $9      
          3        ASSIGN                                                   !1, $9
    7     4        INIT_FCALL_BY_NAME                                       'curl_setopt'
          5        SEND_VAR_EX                                              !1
          6        FETCH_CONSTANT                                   ~11     'CURLOPT_URL'
          7        SEND_VAL_EX                                              ~11
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
    8    10        INIT_FCALL_BY_NAME                                       'curl_setopt'
         11        SEND_VAR_EX                                              !1
         12        FETCH_CONSTANT                                   ~13     'CURLOPT_TIMEOUT'
         13        SEND_VAL_EX                                              ~13
         14        SEND_VAL_EX                                              3
         15        DO_FCALL                                      0          
    9    16        INIT_FCALL_BY_NAME                                       'curl_setopt'
         17        SEND_VAR_EX                                              !1
         18        FETCH_CONSTANT                                   ~15     'CURLOPT_FOLLOWLOCATION'
         19        SEND_VAL_EX                                              ~15
         20        SEND_VAL_EX                                              <true>
         21        DO_FCALL                                      0          
   10    22        INIT_FCALL_BY_NAME                                       'curl_setopt'
         23        SEND_VAR_EX                                              !1
         24        FETCH_CONSTANT                                   ~17     'CURLOPT_RETURNTRANSFER'
         25        SEND_VAL_EX                                              ~17
         26        SEND_VAL_EX                                              <true>
         27        DO_FCALL                                      0          
   11    28        INIT_FCALL_BY_NAME                                       'curl_setopt'
         29        SEND_VAR_EX                                              !1
         30        FETCH_CONSTANT                                   ~19     'CURLOPT_HEADER'
         31        SEND_VAL_EX                                              ~19
         32        SEND_VAL_EX                                              <false>
         33        DO_FCALL                                      0          
   14    34        INIT_FCALL_BY_NAME                                       'curl_setopt'
         35        SEND_VAR_EX                                              !1
         36        FETCH_CONSTANT                                   ~21     'CURL_HTTP_VERSION_1_1'
         37        SEND_VAL_EX                                              ~21
         38        SEND_VAL_EX                                              <true>
         39        DO_FCALL                                      0          
   15    40        INIT_FCALL_BY_NAME                                       'curl_setopt'
         41        SEND_VAR_EX                                              !1
         42        FETCH_CONSTANT                                   ~23     'CURLOPT_ENCODING'
         43        SEND_VAL_EX                                              ~23
         44        SEND_VAL_EX                                              'gzip%2C+deflate'
         45        DO_FCALL                                      0          
   16    46        INIT_FCALL_BY_NAME                                       'curl_setopt'
         47        SEND_VAR_EX                                              !1
         48        FETCH_CONSTANT                                   ~25     'CURLOPT_USERAGENT'
         49        SEND_VAL_EX                                              ~25
         50        SEND_VAL_EX                                              'Mozilla%2F5.0+%28Windows%3B+U%3B+Windows+NT+5.1%3B+en-US%3B+rv%3A1.9.0.3%29+Gecko%2F2008092417+Firefox%2F3.0.3'
         51        DO_FCALL                                      0          
   18    52        INIT_FCALL_BY_NAME                                       'curl_exec'
         53        SEND_VAR_EX                                              !1
         54        DO_FCALL                                      0  $27     
         55        ASSIGN                                                   !2, $27
   20    56        INIT_FCALL                                               'substr'
         57        SEND_VAR                                                 !2
         58        INIT_FCALL                                               'strpos'
         59        SEND_VAR                                                 !2
         60        SEND_VAL                                                 '%3Cbody%3E'
         61        DO_ICALL                                         $29     
         62        SEND_VAR                                                 $29
         63        DO_ICALL                                         $30     
         64        ASSIGN                                                   !2, $30
   25    65        INIT_FCALL                                               'preg_match_all'
         66        SEND_VAL                                                 '%40src%3D%5B%27%22%5D%28%3F%3Ahttp%28%3F%3As%29%2A%3A%29%2A%28%3F%3A%2F%2F%29%2A%28%3FP%3Csrc%3E%5Ba-zA-Z0-9%2F_%5C-%5C.%5D%2B%28jpg%7Cpng%7Cgif%7Cjpeg%7Ctif%29%29%5B%27%22%5C%3F%25%5D%40i'
         67        SEND_VAR                                                 !2
         68        SEND_REF                                                 !3
         69        DO_ICALL                                                 
   37    70        NEW                                              $33     'stdClass'
         71        DO_FCALL                                      0          
         72        ASSIGN                                                   !4, $33
   38    73        ASSIGN_OBJ                                               !4, 'size'
         74        OP_DATA                                                  0
   39    75        ASSIGN_OBJ                                               !4, 'url'
         76        OP_DATA                                                  null
   41    77        FETCH_DIM_R                                      ~38     !3, 'src'
         78      > FE_RESET_R                                       $39     ~38, ->118
         79    > > FE_FETCH_R                                               $39, !5, ->118
   43    80    >   CONCAT                                           ~40     'http%3A%2F%2F', !5
         81        ASSIGN                                                   !5, ~40
   44    82        INIT_FCALL                                               'getimagesize'
         83        SEND_VAR                                                 !5
         84        DO_ICALL                                         $42     
         85        ASSIGN                                                   !6, $42
   45    86        CONCAT                                           ~44     '%3Cbr%3E', !5
         87        CONCAT                                           ~45     ~44, '%3A'
         88        ECHO                                                     ~45
         89        INIT_FCALL                                               'var_dump'
         90        SEND_VAR                                                 !6
         91        DO_ICALL                                                 
         92        ECHO                                                     '%3Cbr%3E'
   46    93      > JMPZ_EX                                          ~47     !6, ->97
         94    >   FETCH_DIM_R                                      ~48     !6, 0
         95        IS_SMALLER                                       ~49     400, ~48
         96        BOOL                                             ~47     ~49
         97    > > JMPZ_EX                                          ~47     ~47, ->104
         98    >   FETCH_DIM_R                                      ~50     !6, 0
         99        FETCH_DIM_R                                      ~51     !6, 1
        100        MUL                                              ~52     ~50, ~51
        101        FETCH_OBJ_R                                      ~53     !4, 'size'
        102        IS_SMALLER                                       ~54     ~53, ~52
        103        BOOL                                             ~47     ~54
        104    > > JMPZ                                                     ~47, ->112
   47   105    >   FETCH_DIM_R                                      ~56     !6, 0
        106        FETCH_DIM_R                                      ~57     !6, 1
        107        MUL                                              ~58     ~56, ~57
        108        ASSIGN_OBJ                                               !4, 'size'
        109        OP_DATA                                                  ~58
   48   110        ASSIGN_OBJ                                               !4, 'url'
        111        OP_DATA                                                  !5
        112    > > JMP                                                      ->117
   50   113  E > > CATCH                                       last         'Exception'
   51   114    >   INIT_STATIC_METHOD_CALL                                  'Debugbar', 'addError'
        115        SEND_VAR_EX                                              !7
        116        DO_FCALL                                      0          
   41   117    > > JMP                                                      ->79
        118    >   FE_FREE                                                  $39
   55   119        FETCH_OBJ_R                                      ~61     !4, 'url'
        120        CONCAT                                           ~62     '%3Cimg+src%3D%27', ~61
        121        CONCAT                                           ~63     ~62, '%27%3E%3Cbr%3E'
        122        ECHO                                                     ~63
   57   123      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
247.57 ms | 1408 KiB | 24 Q