3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * What is the DOM Core Version is Supported by PHP DOM? */ $dom = new DOMDocument(); $dom->loadXML('<root/>'); $element = $dom->documentElement; function dom_list_feature(DOMDocument $dom, $feature, array $versions) { echo "$feature Feature is in PHP DOMDocument implementation:\n\n"; $found = []; foreach ($versions as $i => $version) { $result = $dom->implementation->hasFeature($feature, $version); if ($result) { $found[] = $version; } printf(" %d.) $feature %' -5s: %s\n", $i + 1, var_export($version, true), $result ? 'TRUE' : 'FALSE'); } $count = count($found); printf("\n%s %s versions found%s.\n\n", $count, $feature, $found ? ': ' . implode('; ', $found) : ''); } # Test DOMDocument in PHP Support for DOM-Core Feature # Document Object Model (DOM) <http://www.w3.org/DOM/DOMTR> dom_list_feature($dom, "Core", array('3.0', '2.0', '1.0', '', NULL)); # Test DOMDocument in PHP Support for DOM-XPath Feature # Document Object Model XPath <http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html> dom_list_feature($dom, "XPath", array('3.0', '2.0', '1.0', '', NULL));
Output for git.master, git.master_jit, rfc.property-hooks
Core Feature is in PHP DOMDocument implementation: 1.) Core '3.0': FALSE 2.) Core '2.0': FALSE 3.) Core '1.0': TRUE 4.) Core '' : FALSE Deprecated: DOMImplementation::hasFeature(): Passing null to parameter #2 ($version) of type string is deprecated in /in/cOOnG on line 19 5.) Core NULL : FALSE 1 Core versions found: 1.0. XPath Feature is in PHP DOMDocument implementation: 1.) XPath '3.0': FALSE 2.) XPath '2.0': FALSE 3.) XPath '1.0': FALSE 4.) XPath '' : FALSE Deprecated: DOMImplementation::hasFeature(): Passing null to parameter #2 ($version) of type string is deprecated in /in/cOOnG on line 19 5.) XPath NULL : FALSE 0 XPath versions found.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.93 ms | 402 KiB | 8 Q