3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<STR <p value="1,'goahead'" your='56' so='"<br />"'> STR; $DOM = new DOMDocument; $DOM->loadHTML($str); $p = $DOM->getElementsByTagName('p')->item(0); if ($p->hasAttributes()) { foreach ($p->attributes as $attr) { $name = $attr->nodeName; $value = $attr->nodeValue; echo "Attribute $name : $value \n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 32
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 31
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 31
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 32
filename:       /in/nhYKh
function name:  (null)
number of ops:  33
compiled vars:  !0 = $str, !1 = $DOM, !2 = $p, !3 = $attr, !4 = $name, !5 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cp+value%3D%221%2C%27goahead%27%22+your%3D%2756%27+so%3D%27%22%3Cbr+%2F%3E%22%27%3E'
    6     1        NEW                                              $7      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $7
    7     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    8     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'p'
          9        DO_FCALL                                      0  $11     
         10        INIT_METHOD_CALL                                         $11, 'item'
         11        SEND_VAL_EX                                              0
         12        DO_FCALL                                      0  $12     
         13        ASSIGN                                                   !2, $12
    9    14        INIT_METHOD_CALL                                         !2, 'hasAttributes'
         15        DO_FCALL                                      0  $14     
         16      > JMPZ                                                     $14, ->32
   10    17    >   FETCH_OBJ_R                                      ~15     !2, 'attributes'
         18      > FE_RESET_R                                       $16     ~15, ->31
         19    > > FE_FETCH_R                                               $16, !3, ->31
   11    20    >   FETCH_OBJ_R                                      ~17     !3, 'nodeName'
         21        ASSIGN                                                   !4, ~17
   12    22        FETCH_OBJ_R                                      ~19     !3, 'nodeValue'
         23        ASSIGN                                                   !5, ~19
   13    24        ROPE_INIT                                     5  ~22     'Attribute+'
         25        ROPE_ADD                                      1  ~22     ~22, !4
         26        ROPE_ADD                                      2  ~22     ~22, '+%3A+'
         27        ROPE_ADD                                      3  ~22     ~22, !5
         28        ROPE_END                                      4  ~21     ~22, '+%0A'
         29        ECHO                                                     ~21
   10    30      > JMP                                                      ->19
         31    >   FE_FREE                                                  $16
   15    32    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.27 ms | 1395 KiB | 13 Q