3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace DOMWorks; use \DOMNode, \DOMDocument; class Node extends DOMNode { public function foo() { echo "Yay for foo!"; } } class Element extends DOMElement { public function bar() { echo "Yay for bar!"; } } class Document extends DOMDocument { public function __construct($version = null, $encoding = null) { parent::__construct($version, $encoding); $this->registerNodeClass('DOMElement', __NAMESPACE__ . '\Element'); $this->registerNodeClass('DOMNode', __NAMESPACE__ . '\Node'); } // methods... } $doc = new Document; $doc->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G8ZAG
function name:  (null)
number of ops:  7
compiled vars:  !0 = $doc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   DECLARE_CLASS                                            'domworks%5Celement', 'domworks%5Cdomelement'
   36     1        NEW                                              $1      'DOMWorks%5CDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   37     4        INIT_METHOD_CALL                                         !0, 'foo'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class DOMWorks\Node:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G8ZAG
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'Yay+for+foo%21'
   13     1      > RETURN                                                   null

End of function foo

End of class DOMWorks\Node.

Class DOMWorks\Element:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G8ZAG
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ECHO                                                     'Yay+for+bar%21'
   21     1      > RETURN                                                   null

End of function bar

End of class DOMWorks\Element.

Class DOMWorks\Document:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G8ZAG
function name:  __construct
number of ops:  15
compiled vars:  !0 = $version, !1 = $encoding
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
   28     2        INIT_STATIC_METHOD_CALL                                  
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   29     6        INIT_METHOD_CALL                                         'registerNodeClass'
          7        SEND_VAL_EX                                              'DOMElement'
          8        SEND_VAL_EX                                              'DOMWorks%5CElement'
          9        DO_FCALL                                      0          
   30    10        INIT_METHOD_CALL                                         'registerNodeClass'
         11        SEND_VAL_EX                                              'DOMNode'
         12        SEND_VAL_EX                                              'DOMWorks%5CNode'
         13        DO_FCALL                                      0          
   31    14      > RETURN                                                   null

End of function __construct

End of class DOMWorks\Document.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.87 ms | 1395 KiB | 13 Q