Warning: Use of undefined constant XML_PI_NODE – assumed ‘XML_PI_NODE’ (this will throw an Error in a future version of PHP)[FIXED]

Warning: Use of undefined constant XML_PI_NODE – assumed ‘XML_PI_NODE’ (this will throw an Error in a future version of PHP)[FIXED]

I have an issue with Symfony.
Here it is :

Warning: Use of undefined constant XML_PI_NODE - assumed 'XML_PI_NODE' (this will throw an Error in a future version of PHP)

I’m using php7.2.
XML_PI_NODE usages are in DOMCaster :

private static $nodeTypes = [
        XML_ELEMENT_NODE => 'XML_ELEMENT_NODE',
        XML_ATTRIBUTE_NODE => 'XML_ATTRIBUTE_NODE',
        XML_TEXT_NODE => 'XML_TEXT_NODE',
        XML_CDATA_SECTION_NODE => 'XML_CDATA_SECTION_NODE',
        XML_ENTITY_REF_NODE => 'XML_ENTITY_REF_NODE',
        XML_ENTITY_NODE => 'XML_ENTITY_NODE',
        XML_PI_NODE => 'XML_PI_NODE',
        XML_COMMENT_NODE => 'XML_COMMENT_NODE',
        XML_DOCUMENT_NODE => 'XML_DOCUMENT_NODE',
        XML_DOCUMENT_TYPE_NODE => 'XML_DOCUMENT_TYPE_NODE',
        XML_DOCUMENT_FRAG_NODE => 'XML_DOCUMENT_FRAG_NODE',
        XML_NOTATION_NODE => 'XML_NOTATION_NODE',
        XML_HTML_DOCUMENT_NODE => 'XML_HTML_DOCUMENT_NODE',
        XML_DTD_NODE => 'XML_DTD_NODE',
        XML_ELEMENT_DECL_NODE => 'XML_ELEMENT_DECL_NODE',
        XML_ATTRIBUTE_DECL_NODE => 'XML_ATTRIBUTE_DECL_NODE',
        XML_ENTITY_DECL_NODE => 'XML_ENTITY_DECL_NODE',
        XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE',
    ];

And the constant is defined in dom.php :

define ('XML_PI_NODE', 7);

How can I fix this ?

Source: Symfony Questions

One thought on “Warning: Use of undefined constant XML_PI_NODE – assumed ‘XML_PI_NODE’ (this will throw an Error in a future version of PHP)[FIXED]

Leave a Reply

Your email address will not be published. Required fields are marked *