3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parse_attributes($input) { $dom = new DomDocument(); $dom->loadHtml("<foo " . $input. "/>"); $attributes = array(); foreach ($dom->documentElement->attributes as $name => $attr) { $attributes[$name] = $node->value; } return $attributes; } $content = 'width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/156742959&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"'; $params = parse_attributes($content); var_dump($params);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chTdK
function name:  (null)
number of ops:  9
compiled vars:  !0 = $content, !1 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, 'width%3D%22100%25%22+height%3D%22166%22+scrolling%3D%22no%22+frameborder%3D%22no%22+src%3D%22https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%2F%2Fapi.soundcloud.com%2Ftracks%2F156742959%26amp%3Bcolor%3Dff5500%26amp%3Bauto_play%3Dfalse%26amp%3Bhide_related%3Dfalse%26amp%3Bshow_comments%3Dtrue%26amp%3Bshow_user%3Dtrue%26amp%3Bshow_reposts%3Dfalse%22'
   13     1        INIT_FCALL                                               'parse_attributes'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
   14     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function parse_attributes:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/chTdK
function name:  parse_attributes
number of ops:  22
compiled vars:  !0 = $input, !1 = $dom, !2 = $attributes, !3 = $attr, !4 = $name, !5 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        NEW                                              $6      'DomDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
    4     4        INIT_METHOD_CALL                                         !1, 'loadHtml'
          5        CONCAT                                           ~9      '%3Cfoo+', !0
          6        CONCAT                                           ~10     ~9, '%2F%3E'
          7        SEND_VAL_EX                                              ~10
          8        DO_FCALL                                      0          
    5     9        ASSIGN                                                   !2, <array>
    6    10        FETCH_OBJ_R                                      ~13     !1, 'documentElement'
         11        FETCH_OBJ_R                                      ~14     ~13, 'attributes'
         12      > FE_RESET_R                                       $15     ~14, ->19
         13    > > FE_FETCH_R                                       ~16     $15, !3, ->19
         14    >   ASSIGN                                                   !4, ~16
    7    15        FETCH_OBJ_R                                      ~19     !5, 'value'
         16        ASSIGN_DIM                                               !2, !4
         17        OP_DATA                                                  ~19
    6    18      > JMP                                                      ->13
         19    >   FE_FREE                                                  $15
    9    20      > RETURN                                                   !2
   10    21*     > RETURN                                                   null

End of function parse_attributes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.31 ms | 1407 KiB | 16 Q