3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '<div data-design="05" data-test="test"></div>'; $xml = simplexml_load_string($str); $dom = dom_import_simplexml($xml); echo $dom->getAttribute('data-design');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ocl5i
function name:  (null)
number of ops:  14
compiled vars:  !0 = $str, !1 = $xml, !2 = $dom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cdiv+data-design%3D%2205%22+data-test%3D%22test%22%3E%3C%2Fdiv%3E'
    4     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    5     5        INIT_FCALL                                               'dom_import_simplexml'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !2, $6
    7     9        INIT_METHOD_CALL                                         !2, 'getAttribute'
         10        SEND_VAL_EX                                              'data-design'
         11        DO_FCALL                                      0  $8      
         12        ECHO                                                     $8
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.34 ms | 1385 KiB | 17 Q