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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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: Tue Apr 23 12:01:31 2024 UTC