php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34682 Echo not printing output with parenthesis and commas
Submitted: 2005-09-29 18:00 UTC Modified: 2005-09-30 22:36 UTC
From: Adam dot Kirk at edu dot sait dot ca Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.0.5 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
44 + 20 = ?
Subscribe to this entry?

 
 [2005-09-29 18:00 UTC] Adam dot Kirk at edu dot sait dot ca
Description:
------------
When using the Echo to output text using a comma but inside the parenthesis () the output doesnt work

Reproduce code:
---------------
<?PHP
$first = Adam;
echo("My Name is ", $first);
?>

Expected result:
----------------
My Name is Adam

Actual result:
--------------
actual results is blank screen

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-29 18:06 UTC] sniper@php.net
Actual result is a parse error. echo is NOT a function.
This is the correct way:

echo "foo", $bar;

 [2005-09-30 22:33 UTC] Adam dot Kirk at edu dot sait dot ca
As to my knowledge echo is a built in method (function) of php and per object oriented standards all methods including print and echo use parenthesis even in all the php 5 text books that I have seen use echo ("Name is ", $first); as consistant standard?
 [2005-09-30 22:36 UTC] derick@php.net
Sorry, but you're wrong. you should not use () with echo (and it's not a function or method, it's a language construct).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 23:01:30 2024 UTC