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); foreach ($DOM->getElementsByTagName('p')->item(0)->attributes as $attr) { $attributes[$attr->nodeName] = $attr->nodeValue; } print_r($attributes);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/eGR3n
function name:  (null)
number of ops:  26
compiled vars:  !0 = $str, !1 = $DOM, !2 = $attr, !3 = $attributes
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                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    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  $9      
         10        INIT_METHOD_CALL                                         $9, 'item'
         11        SEND_VAL_EX                                              0
         12        DO_FCALL                                      0  $10     
         13        FETCH_OBJ_R                                      ~11     $10, 'attributes'
         14      > FE_RESET_R                                       $12     ~11, ->21
         15    > > FE_FETCH_R                                               $12, !2, ->21
    9    16    >   FETCH_OBJ_R                                      ~13     !2, 'nodeName'
         17        FETCH_OBJ_R                                      ~15     !2, 'nodeValue'
         18        ASSIGN_DIM                                               !3, ~13
         19        OP_DATA                                                  ~15
    8    20      > JMP                                                      ->15
         21    >   FE_FREE                                                  $12
   12    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.75 ms | 1395 KiB | 15 Q