3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL | E_STRICT); class MyDOM extends DOMDocument { /** * @param \DOMNode|\DOMNodeList|NULL $context * @return string */ public function saveHTML($context = NULL) { if ($context instanceof \DOMNodeList) { $result = ''; foreach ($context as $node) { $result .= parent::saveHTML($node); } return $result; } return parent::saveHTML($context); } /** * @param \DOMNode|\DOMNodeList|NULL $context * @param int $options * @return string */ public function saveXML($context = NULL, $options = 0) { if ($context instanceof DOMNodeList) { $result = ''; foreach ($context as $node) { $result .= parent::saveXML($node, $options); } return $result; } return parent::saveXML($context, $options); } } $dom = new MyDOM();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qpt4h
function name:  (null)
number of ops:  7
compiled vars:  !0 = $dom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
   41     3        NEW                                              $2      'MyDOM'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
          6      > RETURN                                                   1

Class MyDOM:
Function savehtml:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qpt4h
function name:  saveHTML
number of ops:  18
compiled vars:  !0 = $context, !1 = $result, !2 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV_INIT                                        !0      null
   13     1        INSTANCEOF                                               !0, 'DOMNodeList'
          2      > JMPZ                                                     ~3, ->13
   14     3    >   ASSIGN                                                   !1, ''
   15     4      > FE_RESET_R                                       $5      !0, ->11
          5    > > FE_FETCH_R                                               $5, !2, ->11
   16     6    >   INIT_STATIC_METHOD_CALL                                  'saveHTML'
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0  $6      
          9        ASSIGN_OP                                     8          !1, $6
   15    10      > JMP                                                      ->5
         11    >   FE_FREE                                                  $5
   18    12      > RETURN                                                   !1
   20    13    >   INIT_STATIC_METHOD_CALL                                  'saveHTML'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0  $8      
         16      > RETURN                                                   $8
   21    17*     > RETURN                                                   null

End of function savehtml

Function savexml:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qpt4h
function name:  saveXML
number of ops:  21
compiled vars:  !0 = $context, !1 = $options, !2 = $result, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      0
   29     2        INSTANCEOF                                               !0, 'DOMNodeList'
          3      > JMPZ                                                     ~4, ->15
   30     4    >   ASSIGN                                                   !2, ''
   31     5      > FE_RESET_R                                       $6      !0, ->13
          6    > > FE_FETCH_R                                               $6, !3, ->13
   32     7    >   INIT_STATIC_METHOD_CALL                                  'saveXML'
          8        SEND_VAR_EX                                              !3
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $7      
         11        ASSIGN_OP                                     8          !2, $7
   31    12      > JMP                                                      ->6
         13    >   FE_FREE                                                  $6
   34    14      > RETURN                                                   !2
   36    15    >   INIT_STATIC_METHOD_CALL                                  'saveXML'
         16        SEND_VAR_EX                                              !0
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0  $9      
         19      > RETURN                                                   $9
   37    20*     > RETURN                                                   null

End of function savexml

End of class MyDOM.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.19 ms | 948 KiB | 16 Q