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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: Adam dot Kirk at edu dot sait dot ca
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 05:01:28 2025 UTC