php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8858 Mac line endings cause error message with '?'
Submitted: 2001-01-23 13:21 UTC Modified: 2001-04-27 21:57 UTC
From: davidv at angliaed dot co dot uk Assigned:
Status: Not a bug Package: Reproducible Crash
PHP Version: 4.0.4pl1 OS: Linux/Apache
Private report: No CVE-ID: None
 [2001-01-23 13:21 UTC] davidv at angliaed dot co dot uk
If a PHP source file is saved with Mac line endings (each line ends with character 13 (0x0D) only) then any comment that starts with // and ends with a question mark such as:

// Comment?

will cause an error message to be output to the browser:

Parse error: parse error in /home/www/php/admin/syncdb.php on line 1

Note that the ? is NOT at the end of line 1 but can be anywhere in the script.

With either Unix line endings (0x0A) or PC line endings (0x0D + 0x0A) the problem does not occur.

The system is running apache 1.3.14 on a Linux (RedHat 6.0) i586 server.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-27 21:57 UTC] elixer@php.net
This is not a bug in PHP.  If you are running your scripts on a Unix platform they must be terminated by a '\n' (0x0A).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 04:01:30 2024 UTC