3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <form action="blabla.php" method=post> <input type="text" name="campaign" disabled=""> <input type="text" name="id" value="this-is-what-i-am-trying-to-extract"> </form> HTML; $dom = new DOMDocument(); $dom->loadHTML($html); $xpath = new DOMXPath($dom); $tags = $xpath->query('//input'); foreach ($tags as $tag) { $b = $tag->hasAttribute('disabled') ? true : false; echo $tag->getAttribute('name')." is disabled:".$b."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 33
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 33
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/iQCYW
function name:  (null)
number of ops:  35
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath, !3 = $tags, !4 = $tag, !5 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '++++%3Cform+action%3D%22blabla.php%22+method%3Dpost%3E%0A%0A++++%3Cinput+type%3D%22text%22+name%3D%22campaign%22+disabled%3D%22%22%3E++%0A++++%3Cinput+type%3D%22text%22+name%3D%22id%22+value%3D%22this-is-what-i-am-trying-to-extract%22%3E%0A%0A++++%3C%2Fform%3E'
   12     1        NEW                                              $7      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $7
   13     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   15     7        NEW                                              $11     'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $11
   17    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2F%2Finput'
         13        DO_FCALL                                      0  $14     
         14        ASSIGN                                                   !3, $14
   18    15      > FE_RESET_R                                       $16     !3, ->33
         16    > > FE_FETCH_R                                               $16, !4, ->33
   19    17    >   INIT_METHOD_CALL                                         !4, 'hasAttribute'
         18        SEND_VAL_EX                                              'disabled'
         19        DO_FCALL                                      0  $17     
         20      > JMPZ                                                     $17, ->23
         21    >   QM_ASSIGN                                        ~18     <true>
         22      > JMP                                                      ->24
         23    >   QM_ASSIGN                                        ~18     <false>
         24    >   ASSIGN                                                   !5, ~18
   20    25        INIT_METHOD_CALL                                         !4, 'getAttribute'
         26        SEND_VAL_EX                                              'name'
         27        DO_FCALL                                      0  $20     
         28        CONCAT                                           ~21     $20, '+is+disabled%3A'
         29        CONCAT                                           ~22     ~21, !5
         30        CONCAT                                           ~23     ~22, '%0A'
         31        ECHO                                                     ~23
   18    32      > JMP                                                      ->16
         33    >   FE_FREE                                                  $16
   21    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
264.04 ms | 1399 KiB | 14 Q