3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlString = '<root><item>Hibás XML</item>'; // Hiányzó záró tag. // Átvesszük az irányítást a hibakezelés felett, ez elnyomja az E_WARNING-ot. $previously = \libxml_use_internal_errors(true); try { return new \SimpleXMLElement($xmlString, \LIBXML_NONET | \LIBXML_NOCDATA | \LIBXML_NOBLANKS); } catch (\Throwable $e) { // Begyűjtjük a részletes hibákat a libxml pufferről. $errors = \array_map(static function (\LibXMLError $error): string { $level = match ($error->level) { LIBXML_ERR_WARNING => 'Warning', LIBXML_ERR_ERROR => 'Error', LIBXML_ERR_FATAL => 'Fatal Error', default => 'Unknown', }; return \sprintf('[%s] %s (%d:%d)', $level, \trim($error->message), $error->line, $error->column); }, \libxml_get_errors()); \libxml_clear_errors(); throw new \InvalidArgumentException( \sprintf('SimpleXMLElement parsing failed (%s).', \implode(', ', $errors)), 0, $e, ); } finally { // Visszaállítjuk az eredeti hibakezelési állapotot. \libxml_use_internal_errors($previously); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 39, Position 2 = 10
Branch analysis from position: 39
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/mCsGl
function name:  (null)
number of ops:  44
compiled vars:  !0 = $xmlString, !1 = $previously, !2 = $e, !3 = $errors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Croot%3E%3Citem%3EHib%C3%A1s+XML%3C%2Fitem%3E'
    6     1        INIT_FCALL                                               'libxml_use_internal_errors'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    9     5        NEW                                              $8      'SimpleXMLElement'
          6        SEND_VAR_EX                                              !0
          7        SEND_VAL_EX                                              18688
          8        DO_FCALL                                      0          
          9      > FAST_CALL                                                ->39
         10    > > RETURN                                                   $8
         11*       JMP                                                      ->37
   10    12  E > > CATCH                                       last         'Throwable'
   12    13    >   INIT_FCALL                                               'array_map'
         14        DECLARE_LAMBDA_FUNCTION                          ~10     [0]
   21    15        SEND_VAL                                                 ~10
         16        INIT_FCALL                                               'libxml_get_errors'
         17        DO_ICALL                                         $11     
         18        SEND_VAR                                                 $11
   12    19        DO_ICALL                                         $12     
         20        ASSIGN                                                   !3, $12
   23    21        INIT_FCALL                                               'libxml_clear_errors'
         22        DO_ICALL                                                 
   25    23        NEW                                              $15     'InvalidArgumentException'
   26    24        INIT_FCALL                                               'sprintf'
         25        SEND_VAL                                                 'SimpleXMLElement+parsing+failed+%28%25s%29.'
         26        INIT_FCALL                                               'implode'
         27        SEND_VAL                                                 '%2C+'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $16     
         30        SEND_VAR                                                 $16
         31        DO_ICALL                                         $17     
         32        SEND_VAR_NO_REF_EX                                       $17
   27    33        SEND_VAL_EX                                              0
   26    34        SEND_VAR_EX                                              !2
   25    35        DO_FCALL                                      0          
   26    36      > THROW                                         0          $15
   30    37*       FAST_CALL                                                ->39
         38*       JMP                                                      ->43
   32    39    >   INIT_FCALL                                               'libxml_use_internal_errors'
         40        SEND_VAR                                                 !1
         41        DO_ICALL                                                 
         42      > FAST_RET                                                 
   33    43*     > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
4 jumps found. (Code = 195) Position 1 = 3, Position 2 = 5, Position 3 = 7, Position 4 = 9
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
filename:       /in/mCsGl
function name:  {closure}
number of ops:  30
compiled vars:  !0 = $error, !1 = $level
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        FETCH_OBJ_R                                      ~2      !0, 'level'
          2      > MATCH                                                    ~2, [ 1:->3, 2:->5, 3:->7, ], ->9
   14     3    >   QM_ASSIGN                                        ~4      'Warning'
          4      > JMP                                                      ->11
   15     5    >   QM_ASSIGN                                        ~4      'Error'
          6      > JMP                                                      ->11
   16     7    >   QM_ASSIGN                                        ~4      'Fatal+Error'
          8      > JMP                                                      ->11
   17     9    >   QM_ASSIGN                                        ~4      'Unknown'
         10      > JMP                                                      ->11
         11    >   FREE                                                     ~2
   13    12        ASSIGN                                                   !1, ~4
   20    13        INIT_FCALL                                               'sprintf'
         14        SEND_VAL                                                 '%5B%25s%5D+%25s+%28%25d%3A%25d%29'
         15        SEND_VAR                                                 !1
         16        INIT_FCALL                                               'trim'
         17        FETCH_OBJ_R                                      ~6      !0, 'message'
         18        SEND_VAL                                                 ~6
         19        DO_ICALL                                         $7      
         20        SEND_VAR                                                 $7
         21        FETCH_OBJ_R                                      ~8      !0, 'line'
         22        SEND_VAL                                                 ~8
         23        FETCH_OBJ_R                                      ~9      !0, 'column'
         24        SEND_VAL                                                 ~9
         25        DO_ICALL                                         $10     
         26        VERIFY_RETURN_TYPE                                       $10
         27      > RETURN                                                   $10
   21    28*       VERIFY_RETURN_TYPE                                       
         29*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.06 ms | 1017 KiB | 20 Q