3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <root>Тест кириллицы</root> '; $original = new DOMDocument; $original->loadXML($xml); echo $original->saveXML(); echo PHP_EOL . PHP_EOL; // this is code from \SebastianBergmann\Comparator\DOMNodeComparator::nodeToText $document = new DOMDocument; @$document->loadXML($original->C14N()); echo $document->saveXML(); echo PHP_EOL . PHP_EOL; // if I add utf-8 xml header then document is good $document = new DOMDocument; @$document->loadXML('<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL . $original->C14N()); echo $document->saveXML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FvCAs
function name:  (null)
number of ops:  40
compiled vars:  !0 = $xml, !1 = $original, !2 = $document
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Croot%3E%D0%A2%D0%B5%D1%81%D1%82+%D0%BA%D0%B8%D1%80%D0%B8%D0%BB%D0%BB%D0%B8%D1%86%D1%8B%3C%2Froot%3E%0A'
    7     1        NEW                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    8     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   10     7        INIT_METHOD_CALL                                         !1, 'saveXML'
          8        DO_FCALL                                      0  $8      
          9        ECHO                                                     $8
   12    10        ECHO                                                     '%0A%0A'
   15    11        NEW                                              $9      'DOMDocument'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $9
   16    14        BEGIN_SILENCE                                    ~12     
         15        INIT_METHOD_CALL                                         !2, 'loadXML'
         16        INIT_METHOD_CALL                                         !1, 'C14N'
         17        DO_FCALL                                      0  $13     
         18        SEND_VAR_NO_REF_EX                                       $13
         19        DO_FCALL                                      0          
         20        END_SILENCE                                              ~12
   17    21        INIT_METHOD_CALL                                         !2, 'saveXML'
         22        DO_FCALL                                      0  $15     
         23        ECHO                                                     $15
   19    24        ECHO                                                     '%0A%0A'
   22    25        NEW                                              $16     'DOMDocument'
         26        DO_FCALL                                      0          
         27        ASSIGN                                                   !2, $16
   23    28        BEGIN_SILENCE                                    ~19     
         29        INIT_METHOD_CALL                                         !2, 'loadXML'
         30        INIT_METHOD_CALL                                         !1, 'C14N'
         31        DO_FCALL                                      0  $20     
         32        CONCAT                                           ~21     '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A', $20
         33        SEND_VAL_EX                                              ~21
         34        DO_FCALL                                      0          
         35        END_SILENCE                                              ~19
   24    36        INIT_METHOD_CALL                                         !2, 'saveXML'
         37        DO_FCALL                                      0  $23     
         38        ECHO                                                     $23
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.54 ms | 1435 KiB | 13 Q