php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65573 Parsing fails on simple one line echo
Submitted: 2013-08-28 15:16 UTC Modified: 2013-08-28 15:45 UTC
From: phpnet at theodore dot phpexperts dot pro Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.4.19 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phpnet at theodore dot phpexperts dot pro
New email:
PHP Version: OS:

 

 [2013-08-28 15:16 UTC] phpnet at theodore dot phpexperts dot pro
Description:
------------
PHP Parse error:  syntax error, unexpected 'echo' (T_ECHO) in bad.php on line 2

I have attached the affected file.  I can readily duplicate the issue across 
various PHP instances ranging from 5.2 to 5.4.19, nothing else was tested.


Test script:
---------------
<?php
   echo "This should work. But it doesn't!\n";


Expected result:
----------------
Output:
"This should work. But it doesn't!"

Actual result:
--------------
PHP Parse error:  syntax error, unexpected 'echo' (T_ECHO) in 
/home/tsmith/books/dimensional_shift/test.php on line 2


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-28 15:22 UTC] phpnet at theodore dot phpexperts dot pro
The "Attach file" thing appears to have not worked.  You can get the exact test 
case at http://www.phpexperts.pro/files/bad_php.txt
 [2013-08-28 15:45 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2013-08-28 15:45 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

hexdup shows you have some binary stuff (0a c2 a0  c2 a0) behind the opening tag.

00000000  3c 3f 70 68 70 0a c2 a0  c2 a0 20 65 63 68 6f 20  |<?php..... echo |
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 03 12:01:29 2025 UTC