How can I gracefully escape an error condition? June 8, 2022 by Tarik Billa This line is wrong: $xPath = new DOMXPath(@$dom); Should be this: $xPath = new DOMXPath($dom);