3v4l.org

run code in 300+ PHP versions simultaneously
<?php $body = '<div class="cModule myphotos"> <h3><span>My photos</span></h3> <ul class="cResetList cThumbList clrfix"> <li> <a href="/projects/mysportsjam/index.php/joom-social/103-shine/photos/photo?albumid=12#photoid=67" hidefocus="true" style="outline: none;"><img class="cAvatar jomNameTips cAvatar-sidebar" title="Uploaded by shine s" src="http://107.20.167.165/projects/mysportsjam/images/photos/103/12/thumb_05c0beeb8f0f32a08538dad7.jpg" alt="shine s"></a> </li> <li> <a href="/projects/mysportsjam/index.php/joom-social/103-shine/photos/photo?albumid=12#photoid=43" hidefocus="true" style="outline: none;"><img class="cAvatar jomNameTips cAvatar-sidebar" src="http://107.20.167.165/projects/mysportsjam/images/photos/103/12/thumb_c122ff8dafd2edeba377a1cd.jpg" alt="shine s" original-title="Uploaded by shine s"></a> </li> <li> <a href="/projects/mysportsjam/index.php/joom-social/103-shine/photos/photo?albumid=12#photoid=66" hidefocus="true" style="outline: none;"><img class="cAvatar jomNameTips cAvatar-sidebar" title="Uploaded by shine s" src="http://107.20.167.165/projects/mysportsjam/images/photos/103/12/thumb_9414b5dff6c8644d197ff684.jpg" alt="shine s"></a> </li> </ul> <div class="app-box-footer"> <a href="/projects/mysportsjam/index.php/joom-social/103-shine/photos" hidefocus="true" style="outline: none;">View all photos</a> </div> </div>'; $xml = new DOMDocument(); $xml->loadHTML($body); $nodes = $xml->getElementsByTagName('li'); for($curr = 0; $curr < $nodes->length; $curr++) { $li = $nodes->item($curr); print $li->nodeValue . "\n"; if($li->hasChildNodes()) { $a = $li->firstChild; $href = $a->getAttribute('href'); print "{$href}\n"; } print "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 13
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 32
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 13
Branch analysis from position: 37
Branch analysis from position: 13
Branch analysis from position: 32
filename:       /in/cqJE0
function name:  (null)
number of ops:  38
compiled vars:  !0 = $body, !1 = $xml, !2 = $nodes, !3 = $curr, !4 = $li, !5 = $a, !6 = $href
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cdiv+class%3D%22cModule+myphotos%22%3E%0A%3Ch3%3E%3Cspan%3EMy+photos%3C%2Fspan%3E%3C%2Fh3%3E%0A+%3Cul+class%3D%22cResetList+cThumbList+clrfix%22%3E%0A+++++%3Cli%3E%0A++++++++++%3Ca+href%3D%22%2Fprojects%2Fmysportsjam%2Findex.php%2Fjoom-social%2F103-shine%2Fphotos%2Fphoto%3Falbumid%3D12%23photoid%3D67%22+hidefocus%3D%22true%22+style%3D%22outline%3A+none%3B%22%3E%3Cimg+class%3D%22cAvatar+jomNameTips+cAvatar-sidebar%22+title%3D%22Uploaded+by+shine+s%22+src%3D%22http%3A%2F%2F107.20.167.165%2Fprojects%2Fmysportsjam%2Fimages%2Fphotos%2F103%2F12%2Fthumb_05c0beeb8f0f32a08538dad7.jpg%22+alt%3D%22shine+s%22%3E%3C%2Fa%3E%0A++++%3C%2Fli%3E%0A%0A++++%3Cli%3E%0A++++%3Ca+href%3D%22%2Fprojects%2Fmysportsjam%2Findex.php%2Fjoom-social%2F103-shine%2Fphotos%2Fphoto%3Falbumid%3D12%23photoid%3D43%22+hidefocus%3D%22true%22+style%3D%22outline%3A+none%3B%22%3E%3Cimg+class%3D%22cAvatar+jomNameTips+cAvatar-sidebar%22+src%3D%22http%3A%2F%2F107.20.167.165%2Fprojects%2Fmysportsjam%2Fimages%2Fphotos%2F103%2F12%2Fthumb_c122ff8dafd2edeba377a1cd.jpg%22+alt%3D%22shine+s%22+original-title%3D%22Uploaded+by+shine+s%22%3E%3C%2Fa%3E%0A++++%3C%2Fli%3E%0A%0A++++%3Cli%3E%0A++++%3Ca+href%3D%22%2Fprojects%2Fmysportsjam%2Findex.php%2Fjoom-social%2F103-shine%2Fphotos%2Fphoto%3Falbumid%3D12%23photoid%3D66%22+hidefocus%3D%22true%22+style%3D%22outline%3A+none%3B%22%3E%3Cimg+class%3D%22cAvatar+jomNameTips+cAvatar-sidebar%22+title%3D%22Uploaded+by+shine+s%22+src%3D%22http%3A%2F%2F107.20.167.165%2Fprojects%2Fmysportsjam%2Fimages%2Fphotos%2F103%2F12%2Fthumb_9414b5dff6c8644d197ff684.jpg%22+alt%3D%22shine+s%22%3E%3C%2Fa%3E%0A++++%3C%2Fli%3E%0A++++++++++++%3C%2Ful%3E%0A%0A++++%3Cdiv+class%3D%22app-box-footer%22%3E%0A++++%3Ca+href%3D%22%2Fprojects%2Fmysportsjam%2Findex.php%2Fjoom-social%2F103-shine%2Fphotos%22+hidefocus%3D%22true%22+style%3D%22outline%3A+none%3B%22%3EView+all+photos%3C%2Fa%3E%0A%3C%2Fdiv%3E%0A++++%3C%2Fdiv%3E'
   24     1        NEW                                              $8      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $8
   25     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   27     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'li'
          9        DO_FCALL                                      0  $12     
         10        ASSIGN                                                   !2, $12
   29    11        ASSIGN                                                   !3, 0
         12      > JMP                                                      ->34
   30    13    >   INIT_METHOD_CALL                                         !2, 'item'
         14        SEND_VAR_EX                                              !3
         15        DO_FCALL                                      0  $15     
         16        ASSIGN                                                   !4, $15
   32    17        FETCH_OBJ_R                                      ~17     !4, 'nodeValue'
         18        CONCAT                                           ~18     ~17, '%0A'
         19        ECHO                                                     ~18
   34    20        INIT_METHOD_CALL                                         !4, 'hasChildNodes'
         21        DO_FCALL                                      0  $19     
         22      > JMPZ                                                     $19, ->32
   35    23    >   FETCH_OBJ_R                                      ~20     !4, 'firstChild'
         24        ASSIGN                                                   !5, ~20
   36    25        INIT_METHOD_CALL                                         !5, 'getAttribute'
         26        SEND_VAL_EX                                              'href'
         27        DO_FCALL                                      0  $22     
         28        ASSIGN                                                   !6, $22
   38    29        NOP                                                      
         30        FAST_CONCAT                                      ~24     !6, '%0A'
         31        ECHO                                                     ~24
   41    32    >   ECHO                                                     '%0A'
   29    33        PRE_INC                                                  !3
         34    >   FETCH_OBJ_R                                      ~26     !2, 'length'
         35        IS_SMALLER                                               !3, ~26
         36      > JMPNZ                                                    ~27, ->13
   42    37    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.57 ms | 1403 KiB | 13 Q