3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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); } } $dom = new MyDOM();
based on QXIrK
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/cgjjT
function name:  (null)
number of ops:  9
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                                                 
   6     3        NOP                                                      
         4        NOP                                                      
  25     5        NEW                                              $4      :-2
         6        DO_FCALL                                      0          
         7        ASSIGN                                                   !0, $4
         8      > RETURN                                                   1

Class MyDOM:
Function savehtml:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
Jump found. Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
Jump found. Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
Jump found. Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
Jump found. Position 1 = -2
Branch analysis from position: 12
Branch analysis from position: 14
Jump found. Position 1 = -2
filename:       /in/cgjjT
function name:  saveHTML
number of ops:  20
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                                       ~3      !0, 'DOMNodeList'
         2      > JMPZ                                                     ~3, ->14
  14     3    >   ASSIGN                                                   !1, ''
  15     4      > FE_RESET_R                                       $5      !0, ->12
         5    > > FE_FETCH_R                                               $5, !2, ->12
  16     6    >   FETCH_CLASS                                 514  :6      
         7        INIT_STATIC_METHOD_CALL                                  $6, 'saveHTML'
         8        SEND_VAR_EX                                              !2
         9        DO_FCALL                                      0  $7      
        10        ASSIGN_CONCAT                                 0          !1, $7
        11      > JMP                                                      ->5
        12    >   FE_FREE                                                  $5
  18    13      > RETURN                                                   !1
  20    14    >   FETCH_CLASS                                 514  :9      
        15        INIT_STATIC_METHOD_CALL                                  $9, 'saveHTML'
        16        SEND_VAR_EX                                              !0
        17        DO_FCALL                                      0  $10     
        18      > RETURN                                                   $10
  21    19*     > RETURN                                                   null

End of function savehtml

End of class MyDOM.

Generated using Vulcan Logic Dumper, using php 7.2.0