3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { libxml_use_internal_errors(true); $xml = new SimpleXMLElement('<test><b>& Fart</test></b>'); } catch (\Exception $e) { $xml = new SimpleXMLElement('<errors/>'); foreach(libxml_get_errors() as $error) { $xml->addChild('error', $error->message); }; libxml_clear_errors(); echo $xml->asXml(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 24
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 24
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/21mud
function name:  (null)
number of ops:  31
compiled vars:  !0 = $xml, !1 = $e, !2 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'libxml_use_internal_errors'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                                 
    4     3        NEW                                              $4      'SimpleXMLElement'
          4        SEND_VAL_EX                                              '%3Ctest%3E%3Cb%3E%26+Fart%3C%2Ftest%3E%3C%2Fb%3E'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $4
          7      > JMP                                                      ->30
    5     8  E > > CATCH                                       last         'Exception'
    6     9    >   NEW                                              $7      'SimpleXMLElement'
         10        SEND_VAL_EX                                              '%3Cerrors%2F%3E'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !0, $7
    7    13        INIT_FCALL                                               'libxml_get_errors'
         14        DO_ICALL                                         $10     
         15      > FE_RESET_R                                       $11     $10, ->24
         16    > > FE_FETCH_R                                               $11, !2, ->24
    8    17    >   INIT_METHOD_CALL                                         !0, 'addChild'
         18        SEND_VAL_EX                                              'error'
         19        CHECK_FUNC_ARG                                           
         20        FETCH_OBJ_FUNC_ARG                               $12     !2, 'message'
         21        SEND_FUNC_ARG                                            $12
         22        DO_FCALL                                      0          
    7    23      > JMP                                                      ->16
         24    >   FE_FREE                                                  $11
   11    25        INIT_FCALL                                               'libxml_clear_errors'
         26        DO_ICALL                                                 
   12    27        INIT_METHOD_CALL                                         !0, 'asXml'
         28        DO_FCALL                                      0  $15     
         29        ECHO                                                     $15
   13    30    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.51 ms | 1396 KiB | 19 Q