3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0" encoding="UTF-8"?> <ns1:Root xmlns:ns1="http://example.com/custom"> <ns1:Node>There's stuff here</ns1:Node> </ns1:Root> XML; $simplexml = simplexml_load_string($xml); // This prints "Parse Error". echo ($simplexml ? 'Valid XML' : 'Parse Error'), PHP_EOL; // But this prints "There's stuff here", proving that // the SimpleXML object was created successfully. echo $simplexml->children('http://example.com/custom')->Node, PHP_EOL; // The documentation should instruct us to use this instead: echo ($simplexml !== FALSE ? 'Valid XML' : 'Parse Error'), PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
Branch analysis from position: 21
filename:       /in/uUUDH
function name:  (null)
number of ops:  25
compiled vars:  !0 = $xml, !1 = $simplexml
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%3Cns1%3ARoot+xmlns%3Ans1%3D%22http%3A%2F%2Fexample.com%2Fcustom%22%3E%0A%3Cns1%3ANode%3EThere%27s+stuff+here%3C%2Fns1%3ANode%3E%0A%3C%2Fns1%3ARoot%3E'
   10     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
   13     5      > JMPZ                                                     !1, ->8
          6    >   QM_ASSIGN                                        ~5      'Valid+XML'
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~5      'Parse+Error'
          9    >   ECHO                                                     ~5
         10        ECHO                                                     '%0A'
   17    11        INIT_METHOD_CALL                                         !1, 'children'
         12        SEND_VAL_EX                                              'http%3A%2F%2Fexample.com%2Fcustom'
         13        DO_FCALL                                      0  $6      
         14        FETCH_OBJ_R                                      ~7      $6, 'Node'
         15        ECHO                                                     ~7
         16        ECHO                                                     '%0A'
   20    17        TYPE_CHECK                                  1018          !1
         18      > JMPZ                                                     ~8, ->21
         19    >   QM_ASSIGN                                        ~9      'Valid+XML'
         20      > JMP                                                      ->22
         21    >   QM_ASSIGN                                        ~9      'Parse+Error'
         22    >   ECHO                                                     ~9
         23        ECHO                                                     '%0A'
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.59 ms | 1396 KiB | 15 Q