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"; foreach($li->childNodes as $child) { $a = $child; if(is_a($a, "DOMElement")) { $href = $a->getAttribute('href'); print "{$href}\n"; } } print "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 13
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 37
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 37
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 36
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 36
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 13
Branch analysis from position: 43
Branch analysis from position: 13
Branch analysis from position: 37
filename:       /in/lsUZH
function name:  (null)
number of ops:  44
compiled vars:  !0 = $body, !1 = $xml, !2 = $nodes, !3 = $curr, !4 = $li, !5 = $child, !6 = $a, !7 = $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                                              $9      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $9
   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  $13     
         10        ASSIGN                                                   !2, $13
   29    11        ASSIGN                                                   !3, 0
         12      > JMP                                                      ->40
   30    13    >   INIT_METHOD_CALL                                         !2, 'item'
         14        SEND_VAR_EX                                              !3
         15        DO_FCALL                                      0  $16     
         16        ASSIGN                                                   !4, $16
   32    17        FETCH_OBJ_R                                      ~18     !4, 'nodeValue'
         18        CONCAT                                           ~19     ~18, '%0A'
         19        ECHO                                                     ~19
   34    20        FETCH_OBJ_R                                      ~20     !4, 'childNodes'
         21      > FE_RESET_R                                       $21     ~20, ->37
         22    > > FE_FETCH_R                                               $21, !5, ->37
   35    23    >   ASSIGN                                                   !6, !5
   37    24        INIT_FCALL                                               'is_a'
         25        SEND_VAR                                                 !6
         26        SEND_VAL                                                 'DOMElement'
         27        DO_ICALL                                         $23     
         28      > JMPZ                                                     $23, ->36
   38    29    >   INIT_METHOD_CALL                                         !6, 'getAttribute'
         30        SEND_VAL_EX                                              'href'
         31        DO_FCALL                                      0  $24     
         32        ASSIGN                                                   !7, $24
   40    33        NOP                                                      
         34        FAST_CONCAT                                      ~26     !7, '%0A'
         35        ECHO                                                     ~26
   34    36    > > JMP                                                      ->22
         37    >   FE_FREE                                                  $21
   44    38        ECHO                                                     '%0A'
   29    39        PRE_INC                                                  !3
         40    >   FETCH_OBJ_R                                      ~28     !2, 'length'
         41        IS_SMALLER                                               !3, ~28
         42      > JMPNZ                                                    ~29, ->13
   45    43    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.02 ms | 1400 KiB | 15 Q