3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<< XML <root> <hyphenated-element hyphenated-attribute="bar">foo</hyphenated-element> </root> XML; $root = new SimpleXMLElement($xml); echo $root->{'hyphenated-element'}; // prints "foo" echo $root->{'hyphenated-element'}['hyphenated-attribute']; // prints "bar"
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bRBM2
function name:  (null)
number of ops:  11
compiled vars:  !0 = $xml, !1 = $root
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Croot%3E%0A++++%3Chyphenated-element+hyphenated-attribute%3D%22bar%22%3Efoo%3C%2Fhyphenated-element%3E%0A%3C%2Froot%3E'
    8     1        NEW                                              $3      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
    9     5        FETCH_OBJ_R                                      ~6      !1, 'hyphenated-element'
          6        ECHO                                                     ~6
   10     7        FETCH_OBJ_R                                      ~7      !1, 'hyphenated-element'
          8        FETCH_DIM_R                                      ~8      ~7, 'hyphenated-attribute'
          9        ECHO                                                     ~8
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.48 ms | 1393 KiB | 13 Q