php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54523 echo fatal error
Submitted: 2011-04-13 16:00 UTC Modified: 2013-12-06 07:24 UTC
From: kiminoumm at hotmail dot fr Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.2.17 OS: WIN NT5.2
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-04-13 16:00 UTC] kiminoumm at hotmail dot fr
Description:
------------
I just migrate my script to an old php version (4.3.5) to an newest, and now i get an fatal error when i use the echo function without parameter

Test script:
---------------
echo ;

Expected result:
----------------
a blank thing

Actual result:
--------------
an Fatal error

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-13 16:37 UTC] johannes@php.net
Not sure when/why this broke. You're mentioning 5.2, so it can't be our change from flex to re2c for the scanner. Anyways:

I can see that there are cases where allowing this makes sense. simple example might be a templating system generating code, something like this:

fwrite($file, 'echo '.implode(', ', $texts).';');

On the other hand I don't like having this case in the language ...
 [2013-12-06 07:24 UTC] mike@php.net
-Status: Open +Status: Wont fix
 [2013-12-06 07:24 UTC] mike@php.net
If our semantics were bash-like, I'd see it's usefulness.
 [2013-12-06 16:22 UTC] tyrael@php.net
for the record, this was changed in 5.0:
http://3v4l.org/5HAoe
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 20:01:29 2024 UTC