3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = <<<'HTML' <div> <div id="priceRangeWrapper"> <div id="priceSlider" min="0" max="0"></div> </div> </div> HTML; $dom = new DomDocument; $dom->loadHtml($str); $xpath = new DomXpath($dom); $list = $xpath->query('//*[@id=\'priceSlinder\']'); var_dump($list->item(0)->attributes->getNamedItem('min'));
Output for 7.2.0
Notice: Trying to get property 'attributes' of non-object in /in/DNGRt on line 15 Fatal error: Uncaught Error: Call to a member function getNamedItem() on null in /in/DNGRt:15 Stack trace: #0 {main} thrown in /in/DNGRt on line 15
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Notice: Trying to get property of non-object in /in/DNGRt on line 15 Fatal error: Uncaught Error: Call to a member function getNamedItem() on null in /in/DNGRt:15 Stack trace: #0 {main} thrown in /in/DNGRt on line 15
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Trying to get property of non-object in /in/DNGRt on line 15 Fatal error: Call to a member function getNamedItem() on null in /in/DNGRt on line 15
Process exited with code 255.
Output for 5.3.20 - 5.5.35
Notice: Trying to get property of non-object in /in/DNGRt on line 15 Fatal error: Call to a member function getNamedItem() on a non-object in /in/DNGRt on line 15
Process exited with code 255.