3v4l.org

run code in 300+ PHP versions simultaneously
<?php $document = new DOMDocument(); $document->loadXML('<element attribute="value"/>'); $attribute = $document->documentElement->getAttributeNode('attribute'); var_dump($attribute->textContent); $attribute->textContent = 'new value'; var_dump($attribute->textContent); echo $document->saveXML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ouRV0
function name:  (null)
number of ops:  25
compiled vars:  !0 = $document, !1 = $attribute
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    4     3        INIT_METHOD_CALL                                         !0, 'loadXML'
          4        SEND_VAL_EX                                              '%3Celement+attribute%3D%22value%22%2F%3E'
          5        DO_FCALL                                      0          
    6     6        FETCH_OBJ_R                                      ~6      !0, 'documentElement'
          7        INIT_METHOD_CALL                                         ~6, 'getAttributeNode'
          8        SEND_VAL_EX                                              'attribute'
          9        DO_FCALL                                      0  $7      
         10        ASSIGN                                                   !1, $7
    8    11        INIT_FCALL                                               'var_dump'
         12        FETCH_OBJ_R                                      ~9      !1, 'textContent'
         13        SEND_VAL                                                 ~9
         14        DO_ICALL                                                 
   10    15        ASSIGN_OBJ                                               !1, 'textContent'
         16        OP_DATA                                                  'new+value'
   12    17        INIT_FCALL                                               'var_dump'
         18        FETCH_OBJ_R                                      ~12     !1, 'textContent'
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                                 
   14    21        INIT_METHOD_CALL                                         !0, 'saveXML'
         22        DO_FCALL                                      0  $14     
         23        ECHO                                                     $14
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.27 ms | 1000 KiB | 14 Q