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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.45 ms | 1395 KiB | 15 Q