3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument(); $doc->loadXML('<root>*</root>'); $text = $doc->documentElement->childNodes->item(0); echo "Before Edit: ", $doc->saveXML($text), "\n"; $text->nodeValue = "&"; echo "After Edit 1: ", $doc->saveXML($text), "\n"; $text->nodeValue = "&amp;"; echo "After Edit 2: ", $doc->saveXML($text), "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j88Po
function name:  (null)
number of ops:  35
compiled vars:  !0 = $doc, !1 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    3     3        INIT_METHOD_CALL                                         !0, 'loadXML'
          4        SEND_VAL_EX                                              '%3Croot%3E%2A%3C%2Froot%3E'
          5        DO_FCALL                                      0          
    5     6        FETCH_OBJ_R                                      ~6      !0, 'documentElement'
          7        FETCH_OBJ_R                                      ~7      ~6, 'childNodes'
          8        INIT_METHOD_CALL                                         ~7, 'item'
          9        SEND_VAL_EX                                              0
         10        DO_FCALL                                      0  $8      
         11        ASSIGN                                                   !1, $8
    7    12        ECHO                                                     'Before+Edit%3A+'
         13        INIT_METHOD_CALL                                         !0, 'saveXML'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0  $10     
         16        ECHO                                                     $10
         17        ECHO                                                     '%0A'
    9    18        ASSIGN_OBJ                                               !1, 'nodeValue'
         19        OP_DATA                                                  '%26'
   11    20        ECHO                                                     'After+Edit+1%3A+'
         21        INIT_METHOD_CALL                                         !0, 'saveXML'
         22        SEND_VAR_EX                                              !1
         23        DO_FCALL                                      0  $12     
         24        ECHO                                                     $12
         25        ECHO                                                     '%0A'
   13    26        ASSIGN_OBJ                                               !1, 'nodeValue'
         27        OP_DATA                                                  '%26amp%3B'
   15    28        ECHO                                                     'After+Edit+2%3A+'
         29        INIT_METHOD_CALL                                         !0, 'saveXML'
         30        SEND_VAR_EX                                              !1
         31        DO_FCALL                                      0  $14     
         32        ECHO                                                     $14
         33        ECHO                                                     '%0A'
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.29 ms | 1435 KiB | 13 Q