3v4l.org

run code in 500+ PHP versions simultaneously
<?php $content = <<<CONTENT <span class="ipsHide" data-role="downloadCounterContainer">Download begins in <span data-role="downloadCounter"></span> seconds</span> <a href='https://example.com/forum/files/file/2-content/?do=download&amp;r=24050&amp;confirm=1&amp;t=1&amp;csrfKey=72c4d0ffcabb34c6d6c490cbacbc354ag1536355261' class='ipsButton ipsButton_primary ipsButton_small' data-action="download" >Download</a> CONTENT; $doc = new DOMDocument(); $doc->loadHTML($content); $xpath = new DomXPath($doc); $results = $xpath->query("//a[contains(@class, 'ipsButton') and contains(@class, 'ipsButton_primary') and contains(@class, 'ipsButton_small')]"); foreach ($results as $result) { $url = parse_url($result->getAttribute("href"), PHP_URL_QUERY); parse_str($url, $params); echo $params['csrfKey']; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 32
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 32
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/5TuYQ
function name:  (null)
number of ops:  34
compiled vars:  !0 = $content, !1 = $doc, !2 = $xpath, !3 = $results, !4 = $result, !5 = $url, !6 = $params
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Cspan+class%3D%22ipsHide%22+data-role%3D%22downloadCounterContainer%22%3EDownload+begins+in++%3Cspan+data-role%3D%22downloadCounter%22%3E%3C%2Fspan%3E+seconds%3C%2Fspan%3E%0A++++++++++++++++%3Ca+href%3D%27https%3A%2F%2Fexample.com%2Fforum%2Ffiles%2Ffile%2F2-content%2F%3Fdo%3Ddownload%26amp%3Br%3D24050%26amp%3Bconfirm%3D1%26amp%3Bt%3D1%26amp%3BcsrfKey%3D72c4d0ffcabb34c6d6c490cbacbc354ag1536355261%27+class%3D%27ipsButton+ipsButton_primary+ipsButton_small%27+data-action%3D%22download%22+%3EDownload%3C%2Fa%3E'
    8     1        NEW                                                  $8      'DOMDocument'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $8
    9     4        INIT_METHOD_CALL                                             !1, 'loadHTML'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0          
   10     7        NEW                                                  $12     'DomXPath'
          8        SEND_VAR_EX                                                  !1
          9        DO_FCALL                                          0          
         10        ASSIGN                                                       !2, $12
   11    11        INIT_METHOD_CALL                                             !2, 'query'
         12        SEND_VAL_EX                                                  '%2F%2Fa%5Bcontains%28%40class%2C+%27ipsButton%27%29+and+contains%28%40class%2C+%27ipsButton_primary%27%29+and+contains%28%40class%2C+%27ipsButton_small%27%29%5D'
         13        DO_FCALL                                          0  $15     
         14        ASSIGN                                                       !3, $15
   12    15      > FE_RESET_R                                           $17     !3, ->32
         16    > > FE_FETCH_R                                                   $17, !4, ->32
   13    17    >   INIT_FCALL                                                   'parse_url'
         18        INIT_METHOD_CALL                                             !4, 'getAttribute'
         19        SEND_VAL_EX                                                  'href'
         20        DO_FCALL                                          0  $18     
         21        SEND_VAR                                                     $18
         22        SEND_VAL                                                     6
         23        DO_ICALL                                             $19     
         24        ASSIGN                                                       !5, $19
   14    25        INIT_FCALL                                                   'parse_str'
         26        SEND_VAR                                                     !5
         27        SEND_REF                                                     !6
         28        DO_ICALL                                                     
   15    29        FETCH_DIM_R                                          ~22     !6, 'csrfKey'
         30        ECHO                                                         ~22
   12    31      > JMP                                                          ->16
         32    >   FE_FREE                                                      $17
   16    33      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.28 ms | 2195 KiB | 15 Q