#48124 [NEW]: php -l stops on XML declarations

From: Date: Thu, 30 Apr 2009 19:59:25 +0000
Subject: #48124 [NEW]: php -l stops on XML declarations
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-136605@lists.php.net to get a copy of this message
From: colin at viebrock dot ca Operating system: Linux PHP version: 5.2.9 PHP Bug Type: CGI related Bug description: php -l stops on XML declarations Description: ------------ Using the CLI version, "php -l" will think an XML declaration like: <?xml version="1.0" encoding="UTF-8"?> is PHP code and throw a syntax error Reproduce code: --------------- <?php $a = 1; ?><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>test</title> </head> <body> <p>Test</p> </body> </html> Expected result: ---------------- php -l should not report any errors Actual result: -------------- cmv@web1:~$ php -l test.php PHP Parse error: syntax error, unexpected T_STRING in test.php on line 3 Errors parsing test.php cmv@web1:~$ -- Edit bug report at http://bugs.php.net/?id=48124&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48124&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48124&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48124&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48124&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48124&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48124&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48124&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48124&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48124&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48124&r=support Expected behavior: http://bugs.php.net/fix.php?id=48124&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48124&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48124&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48124&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48124&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48124&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48124&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48124&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48124&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48124&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48124&r=mysqlcfg

« previous php.bugs (#136605) next »