-9

In book of PHP i found a quote

Short tags were, for a time, the standard in the PHP world; however, they do have the major drawback of conflicting with XML processing instructions (e.g.

I can not understand this line. Can any one give me a example of a code.I need a read example which condition the error occurs. It must be code.

anik4e
  • 493
  • 8
  • 16

1 Answers1

2

The beginning of an XML document is something like follows:

<?xml version="1.0" encoding="UTF-8"?>

Notice the <? at the beginning. This would cause a php error when trying to display xml instructions, as with an xml document as it would try to execute what's between the <? and ?>

skrilled
  • 5,350
  • 2
  • 26
  • 48
  • 2
    This is a live code example. Make a php file named xml.php with shortcodes enabled, and put that as a line in the file, it will error out. – skrilled Aug 24 '16 at 17:31
  • why i change the extension? xml extension is not .php – anik4e Aug 24 '16 at 17:36
  • 2
    I can make a .php file return an image, return xml, json data, return anything I want.. Why would an XML document be limited to an XML extension? Many people use .php files to serve up XML data as the XML is not static, which is why shortcodes can conflict with XML instructions. – skrilled Aug 24 '16 at 17:36