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->errors->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 = 31
Branch analysis from position: 31
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 = 25
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/tDmKh
function name:  (null)
number of ops:  32
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%3EFart%3C%2Ftest%3E%3C%2Fb%3E'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $4
          7      > JMP                                                      ->31
    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, ->25
         16    > > FE_FETCH_R                                               $11, !2, ->25
    8    17    >   FETCH_OBJ_R                                      ~12     !0, 'errors'
         18        INIT_METHOD_CALL                                         ~12, 'addChild'
         19        SEND_VAL_EX                                              'error'
         20        CHECK_FUNC_ARG                                           
         21        FETCH_OBJ_FUNC_ARG                               $13     !2, 'message'
         22        SEND_FUNC_ARG                                            $13
         23        DO_FCALL                                      0          
    7    24      > JMP                                                      ->16
         25    >   FE_FREE                                                  $11
   11    26        INIT_FCALL                                               'libxml_clear_errors'
         27        DO_ICALL                                                 
   12    28        INIT_METHOD_CALL                                         !0, 'asXml'
         29        DO_FCALL                                      0  $16     
         30        ECHO                                                     $16
   13    31    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.78 ms | 1396 KiB | 19 Q