3v4l.org

run code in 300+ PHP versions simultaneously
<?php $con = file_get_contents('http://botd.wordpress.com/topsites-ta.xml/');/* Feed Url */ $title = getlinks("<title>", "</title>", $con); // gets Title and stored in array $url = getlinks("<link>", "</link>", $con); // gets Url and stored in array echo "<ul>"; for($i=0; $i < 6; $i++) { echo '<li><a href="'.$url[$i].'" title="'.$title[$i].'" >'.urldecode($title[$i]).'</a></li>'; } echo "</ul>"; function getlinks($s1,$s2,$s) { $myarray=array(); $s1 = strtolower($s1); $s2 = strtolower($s2); $L1 = strlen($s1); $L2 = strlen($s2); $scheck=strtolower($s); do { $pos1 = strpos($scheck,$s1); if($pos1!==false) { $pos2 = strpos(substr($scheck,$pos1+$L1),$s2); if($pos2!==false) { $myarray[]=substr($s,$pos1+$L1,$pos2); $s=substr($s,$pos1+$L1+$pos2+$L2); $scheck=strtolower($s); } } } while (($pos1!==false)and($pos2!==false)); return $myarray; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 19
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 19
Branch analysis from position: 35
Branch analysis from position: 19
filename:       /in/h0VfS
function name:  (null)
number of ops:  37
compiled vars:  !0 = $con, !1 = $title, !2 = $url, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'file_get_contents'
          1        SEND_VAL                                                 'http%3A%2F%2Fbotd.wordpress.com%2Ftopsites-ta.xml%2F'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    4     4        INIT_FCALL_BY_NAME                                       'getlinks'
          5        SEND_VAL_EX                                              '%3Ctitle%3E'
          6        SEND_VAL_EX                                              '%3C%2Ftitle%3E'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $6      
          9        ASSIGN                                                   !1, $6
    5    10        INIT_FCALL_BY_NAME                                       'getlinks'
         11        SEND_VAL_EX                                              '%3Clink%3E'
         12        SEND_VAL_EX                                              '%3C%2Flink%3E'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0  $8      
         15        ASSIGN                                                   !2, $8
    7    16        ECHO                                                     '%3Cul%3E'
    8    17        ASSIGN                                                   !3, 0
         18      > JMP                                                      ->33
    9    19    >   FETCH_DIM_R                                      ~11     !2, !3
         20        CONCAT                                           ~12     '%3Cli%3E%3Ca+href%3D%22', ~11
         21        CONCAT                                           ~13     ~12, '%22+title%3D%22'
         22        FETCH_DIM_R                                      ~14     !1, !3
         23        CONCAT                                           ~15     ~13, ~14
         24        CONCAT                                           ~16     ~15, '%22+%3E'
         25        INIT_FCALL                                               'urldecode'
         26        FETCH_DIM_R                                      ~17     !1, !3
         27        SEND_VAL                                                 ~17
         28        DO_ICALL                                         $18     
         29        CONCAT                                           ~19     ~16, $18
         30        CONCAT                                           ~20     ~19, '%3C%2Fa%3E%3C%2Fli%3E'
         31        ECHO                                                     ~20
    8    32        PRE_INC                                                  !3
         33    >   IS_SMALLER                                               !3, 6
         34      > JMPNZ                                                    ~22, ->19
   11    35    >   ECHO                                                     '%3C%2Ful%3E'
   35    36      > RETURN                                                   1

Function getlinks:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 59
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 59
Branch analysis from position: 39
2 jumps found. (Code = 46) Position 1 = 61, Position 2 = 63
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 20
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 63
Branch analysis from position: 59
Branch analysis from position: 59
filename:       /in/h0VfS
function name:  getlinks
number of ops:  66
compiled vars:  !0 = $s1, !1 = $s2, !2 = $s, !3 = $myarray, !4 = $L1, !5 = $L2, !6 = $scheck, !7 = $pos1, !8 = $pos2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   14     3        ASSIGN                                                   !3, <array>
   15     4        INIT_FCALL                                               'strtolower'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $10     
          7        ASSIGN                                                   !0, $10
   16     8        INIT_FCALL                                               'strtolower'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $12     
         11        ASSIGN                                                   !1, $12
   17    12        STRLEN                                           ~14     !0
         13        ASSIGN                                                   !4, ~14
   18    14        STRLEN                                           ~16     !1
         15        ASSIGN                                                   !5, ~16
   19    16        INIT_FCALL                                               'strtolower'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $18     
         19        ASSIGN                                                   !6, $18
   22    20    >   INIT_FCALL                                               'strpos'
         21        SEND_VAR                                                 !6
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $20     
         24        ASSIGN                                                   !7, $20
   23    25        TYPE_CHECK                                  1018          !7
         26      > JMPZ                                                     ~22, ->59
   24    27    >   INIT_FCALL                                               'strpos'
         28        INIT_FCALL                                               'substr'
         29        SEND_VAR                                                 !6
         30        ADD                                              ~23     !7, !4
         31        SEND_VAL                                                 ~23
         32        DO_ICALL                                         $24     
         33        SEND_VAR                                                 $24
         34        SEND_VAR                                                 !1
         35        DO_ICALL                                         $25     
         36        ASSIGN                                                   !8, $25
   25    37        TYPE_CHECK                                  1018          !8
         38      > JMPZ                                                     ~27, ->59
   26    39    >   INIT_FCALL                                               'substr'
         40        SEND_VAR                                                 !2
         41        ADD                                              ~29     !7, !4
         42        SEND_VAL                                                 ~29
         43        SEND_VAR                                                 !8
         44        DO_ICALL                                         $30     
         45        ASSIGN_DIM                                               !3
         46        OP_DATA                                                  $30
   27    47        INIT_FCALL                                               'substr'
         48        SEND_VAR                                                 !2
         49        ADD                                              ~31     !7, !4
         50        ADD                                              ~32     ~31, !8
         51        ADD                                              ~33     ~32, !5
         52        SEND_VAL                                                 ~33
         53        DO_ICALL                                         $34     
         54        ASSIGN                                                   !2, $34
   28    55        INIT_FCALL                                               'strtolower'
         56        SEND_VAR                                                 !2
         57        DO_ICALL                                         $36     
         58        ASSIGN                                                   !6, $36
   32    59    >   TYPE_CHECK                                  1018  ~38     !7
         60      > JMPZ_EX                                          ~38     ~38, ->63
         61    >   TYPE_CHECK                                  1018  ~39     !8
         62        BOOL                                             ~38     ~39
         63    > > JMPNZ                                                    ~38, ->20
   33    64    > > RETURN                                                   !3
   34    65*     > RETURN                                                   null

End of function getlinks

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.79 ms | 1404 KiB | 23 Q