3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument(); $dom->appendChild($dom->createElement('foo')); $reflection = new ReflectionClass('DOMElement'); var_dump( $reflection->getProperties() );
Output for 8.3.0 - 8.3.4, 8.3.6
array(27) { [0]=> object(ReflectionProperty)#3 (2) { ["name"]=> string(8) "nodeName" ["class"]=> string(7) "DOMNode" } [1]=> object(ReflectionProperty)#4 (2) { ["name"]=> string(9) "nodeValue" ["class"]=> string(7) "DOMNode" } [2]=> object(ReflectionProperty)#5 (2) { ["name"]=> string(8) "nodeType" ["class"]=> string(7) "DOMNode" } [3]=> object(ReflectionProperty)#6 (2) { ["name"]=> string(10) "parentNode" ["class"]=> string(7) "DOMNode" } [4]=> object(ReflectionProperty)#7 (2) { ["name"]=> string(13) "parentElement" ["class"]=> string(7) "DOMNode" } [5]=> object(ReflectionProperty)#8 (2) { ["name"]=> string(10) "childNodes" ["class"]=> string(7) "DOMNode" } [6]=> object(ReflectionProperty)#9 (2) { ["name"]=> string(10) "firstChild" ["class"]=> string(7) "DOMNode" } [7]=> object(ReflectionProperty)#10 (2) { ["name"]=> string(9) "lastChild" ["class"]=> string(7) "DOMNode" } [8]=> object(ReflectionProperty)#11 (2) { ["name"]=> string(15) "previousSibling" ["class"]=> string(7) "DOMNode" } [9]=> object(ReflectionProperty)#12 (2) { ["name"]=> string(11) "nextSibling" ["class"]=> string(7) "DOMNode" } [10]=> object(ReflectionProperty)#13 (2) { ["name"]=> string(10) "attributes" ["class"]=> string(7) "DOMNode" } [11]=> object(ReflectionProperty)#14 (2) { ["name"]=> string(11) "isConnected" ["class"]=> string(7) "DOMNode" } [12]=> object(ReflectionProperty)#15 (2) { ["name"]=> string(13) "ownerDocument" ["class"]=> string(7) "DOMNode" } [13]=> object(ReflectionProperty)#16 (2) { ["name"]=> string(12) "namespaceURI" ["class"]=> string(7) "DOMNode" } [14]=> object(ReflectionProperty)#17 (2) { ["name"]=> string(6) "prefix" ["class"]=> string(7) "DOMNode" } [15]=> object(ReflectionProperty)#18 (2) { ["name"]=> string(9) "localName" ["class"]=> string(7) "DOMNode" } [16]=> object(ReflectionProperty)#19 (2) { ["name"]=> string(7) "baseURI" ["class"]=> string(7) "DOMNode" } [17]=> object(ReflectionProperty)#20 (2) { ["name"]=> string(11) "textContent" ["class"]=> string(7) "DOMNode" } [18]=> object(ReflectionProperty)#21 (2) { ["name"]=> string(7) "tagName" ["class"]=> string(10) "DOMElement" } [19]=> object(ReflectionProperty)#22 (2) { ["name"]=> string(9) "className" ["class"]=> string(10) "DOMElement" } [20]=> object(ReflectionProperty)#23 (2) { ["name"]=> string(2) "id" ["class"]=> string(10) "DOMElement" } [21]=> object(ReflectionProperty)#24 (2) { ["name"]=> string(14) "schemaTypeInfo" ["class"]=> string(10) "DOMElement" } [22]=> object(ReflectionProperty)#25 (2) { ["name"]=> string(17) "firstElementChild" ["class"]=> string(10) "DOMElement" } [23]=> object(ReflectionProperty)#26 (2) { ["name"]=> string(16) "lastElementChild" ["class"]=> string(10) "DOMElement" } [24]=> object(ReflectionProperty)#27 (2) { ["name"]=> string(17) "childElementCount" ["class"]=> string(10) "DOMElement" } [25]=> object(ReflectionProperty)#28 (2) { ["name"]=> string(22) "previousElementSibling" ["class"]=> string(10) "DOMElement" } [26]=> object(ReflectionProperty)#29 (2) { ["name"]=> string(18) "nextElementSibling" ["class"]=> string(10) "DOMElement" } }
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 array(27) { [0]=> object(ReflectionProperty)#3 (2) { ["name"]=> string(8) "nodeName" ["class"]=> string(7) "DOMNode" } [1]=> object(ReflectionProperty)#4 (2) { ["name"]=> string(9) "nodeValue" ["class"]=> string(7) "DOMNode" } [2]=> object(ReflectionProperty)#5 (2) { ["name"]=> string(8) "nodeType" ["class"]=> string(7) "DOMNode" } [3]=> object(ReflectionProperty)#6 (2) { ["name"]=> string(10) "parentNode" ["class"]=> string(7) "DOMNode" } [4]=> object(ReflectionProperty)#7 (2) { ["name"]=> string(13) "parentElement" ["class"]=> string(7) "DOMNode" } [5]=> object(ReflectionProperty)#8 (2) { ["name"]=> string(10) "childNodes" ["class"]=> string(7) "DOMNode" } [6]=> object(ReflectionProperty)#9 (2) { ["name"]=> string(10) "firstChild" ["class"]=> string(7) "DOMNode" } [7]=> object(ReflectionProperty)#10 (2) { ["name"]=> string(9) "lastChild" ["class"]=> string(7) "DOMNode" } [8]=> object(ReflectionProperty)#11 (2) { ["name"]=> string(15) "previousSibling" ["class"]=> string(7) "DOMNode" } [9]=> object(ReflectionProperty)#12 (2) { ["name"]=> string(11) "nextSibling" ["class"]=> string(7) "DOMNode" } [10]=> object(ReflectionProperty)#13 (2) { ["name"]=> string(10) "attributes" ["class"]=> string(7) "DOMNode" } [11]=> object(ReflectionProperty)#14 (2) { ["name"]=> string(11) "isConnected" ["class"]=> string(7) "DOMNode" } [12]=> object(ReflectionProperty)#15 (2) { ["name"]=> string(13) "ownerDocument" ["class"]=> string(7) "DOMNode" } [13]=> object(ReflectionProperty)#16 (2) { ["name"]=> string(12) "namespaceURI" ["class"]=> string(7) "DOMNode" } [14]=> object(ReflectionProperty)#17 (2) { ["name"]=> string(6) "prefix" ["class"]=> string(7) "DOMNode" } [15]=> object(ReflectionProperty)#18 (2) { ["name"]=> string(9) "localName" ["class"]=> string(7) "DOMNode" } [16]=> object(ReflectionProperty)#19 (2) { ["name"]=> string(7) "baseURI" ["class"]=> string(7) "DOMNode" } [17]=> object(ReflectionProperty)#20 (2) { ["name"]=> string(11) "textContent" ["class"]=> string(7) "DOMNode" } [18]=> object(ReflectionProperty)#21 (2) { ["name"]=> string(7) "tagName" ["class"]=> string(10) "DOMElement" } [19]=> object(ReflectionProperty)#22 (2) { ["name"]=> string(9) "className" ["class"]=> string(10) "DOMElement" } [20]=> object(ReflectionProperty)#23 (2) { ["name"]=> string(2) "id" ["class"]=> string(10) "DOMElement" } [21]=> object(ReflectionProperty)#24 (2) { ["name"]=> string(14) "schemaTypeInfo" ["class"]=> string(10) "DOMElement" } [22]=> object(ReflectionProperty)#25 (2) { ["name"]=> string(17) "firstElementChild" ["class"]=> string(10) "DOMElement" } [23]=> object(ReflectionProperty)#26 (2) { ["name"]=> string(16) "lastElementChild" ["class"]=> string(10) "DOMElement" } [24]=> object(ReflectionProperty)#27 (2) { ["name"]=> string(17) "childElementCount" ["class"]=> string(10) "DOMElement" } [25]=> object(ReflectionProperty)#28 (2) { ["name"]=> string(22) "previousElementSibling" ["class"]=> string(10) "DOMElement" } [26]=> object(ReflectionProperty)#29 (2) { ["name"]=> string(18) "nextElementSibling" ["class"]=> string(10) "DOMElement" } }
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
array(23) { [0]=> object(ReflectionProperty)#3 (2) { ["name"]=> string(8) "nodeName" ["class"]=> string(7) "DOMNode" } [1]=> object(ReflectionProperty)#4 (2) { ["name"]=> string(9) "nodeValue" ["class"]=> string(7) "DOMNode" } [2]=> object(ReflectionProperty)#5 (2) { ["name"]=> string(8) "nodeType" ["class"]=> string(7) "DOMNode" } [3]=> object(ReflectionProperty)#6 (2) { ["name"]=> string(10) "parentNode" ["class"]=> string(7) "DOMNode" } [4]=> object(ReflectionProperty)#7 (2) { ["name"]=> string(10) "childNodes" ["class"]=> string(7) "DOMNode" } [5]=> object(ReflectionProperty)#8 (2) { ["name"]=> string(10) "firstChild" ["class"]=> string(7) "DOMNode" } [6]=> object(ReflectionProperty)#9 (2) { ["name"]=> string(9) "lastChild" ["class"]=> string(7) "DOMNode" } [7]=> object(ReflectionProperty)#10 (2) { ["name"]=> string(15) "previousSibling" ["class"]=> string(7) "DOMNode" } [8]=> object(ReflectionProperty)#11 (2) { ["name"]=> string(11) "nextSibling" ["class"]=> string(7) "DOMNode" } [9]=> object(ReflectionProperty)#12 (2) { ["name"]=> string(10) "attributes" ["class"]=> string(7) "DOMNode" } [10]=> object(ReflectionProperty)#13 (2) { ["name"]=> string(13) "ownerDocument" ["class"]=> string(7) "DOMNode" } [11]=> object(ReflectionProperty)#14 (2) { ["name"]=> string(12) "namespaceURI" ["class"]=> string(7) "DOMNode" } [12]=> object(ReflectionProperty)#15 (2) { ["name"]=> string(6) "prefix" ["class"]=> string(7) "DOMNode" } [13]=> object(ReflectionProperty)#16 (2) { ["name"]=> string(9) "localName" ["class"]=> string(7) "DOMNode" } [14]=> object(ReflectionProperty)#17 (2) { ["name"]=> string(7) "baseURI" ["class"]=> string(7) "DOMNode" } [15]=> object(ReflectionProperty)#18 (2) { ["name"]=> string(11) "textContent" ["class"]=> string(7) "DOMNode" } [16]=> object(ReflectionProperty)#19 (2) { ["name"]=> string(7) "tagName" ["class"]=> string(10) "DOMElement" } [17]=> object(ReflectionProperty)#20 (2) { ["name"]=> string(14) "schemaTypeInfo" ["class"]=> string(10) "DOMElement" } [18]=> object(ReflectionProperty)#21 (2) { ["name"]=> string(17) "firstElementChild" ["class"]=> string(10) "DOMElement" } [19]=> object(ReflectionProperty)#22 (2) { ["name"]=> string(16) "lastElementChild" ["class"]=> string(10) "DOMElement" } [20]=> object(ReflectionProperty)#23 (2) { ["name"]=> string(17) "childElementCount" ["class"]=> string(10) "DOMElement" } [21]=> object(ReflectionProperty)#24 (2) { ["name"]=> string(22) "previousElementSibling" ["class"]=> string(10) "DOMElement" } [22]=> object(ReflectionProperty)#25 (2) { ["name"]=> string(18) "nextElementSibling" ["class"]=> string(10) "DOMElement" } }
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
array(0) { }
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/IuYDa on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/IuYDa on line 3

preferences:
323.58 ms | 401 KiB | 459 Q