Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 59605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:01:53+00:00 2026-05-10T18:01:53+00:00

Possible Duplicate: Reference: Comparing PHP's print and echo Is there any major and fundamental

  • 0

Possible Duplicate:
Reference: Comparing PHP's print and echo

Is there any major and fundamental difference between these two functions in PHP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:01:54+00:00Added an answer on May 10, 2026 at 6:01 pm

    From: http://web.archive.org/web/20090221144611/http://faqts.com/knowledge_base/view.phtml/aid/1/fid/40

    1. Speed. There is a difference between the two, but speed-wise it should be irrelevant which one you use. echo is marginally faster since it doesn’t set a return value if you really want to get down to the nitty gritty.

    2. Expression. print() behaves like a function in that you can do: $ret = print 'Hello World'; And $ret will be 1. That means that print can be used as part of a more complex expression where echo cannot. An example from the PHP Manual:

    $b ? print 'true' : print 'false'; 

    print is also part of the precedence table which it needs to be if it is to be used within a complex expression. It is just about at the bottom of the precedence list though. Only , AND OR XOR are lower.

    1. Parameter(s). The grammar is: echo expression [, expression[, expression] ... ] But echo ( expression, expression ) is not valid. This would be valid: echo ('howdy'),('partner'); the same as: echo 'howdy','partner'; (Putting the brackets in that simple example serves no purpose since there is no operator precedence issue with a single term like that.)

    So, echo without parentheses can take multiple parameters, which get concatenated:

       echo  'and a ', 1, 2, 3;   // comma-separated without parentheses    echo ('and a 123');        // just one parameter with parentheses 

    print() can only take one parameter:

       print ('and a 123');    print  'and a 123'; 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You probably want to change substitute v new_var() (typevar v)… May 11, 2026 at 3:35 pm
  • added an answer I am now convinced that it's a javac bug. The… May 11, 2026 at 3:35 pm
  • added an answer My advice for your issues is general because I do… May 11, 2026 at 3:34 pm

Related Questions

Possible Duplicate: Reference: Comparing PHP's print and echo Is there any major and fundamental
Possible Duplicate: Best way to determine if two path reference to same file in
Possible Duplicate: How can I pre-set arguments in JavaScript function call? (Partial Function Application)
Possible Duplicate: When is a function too long? I've recently been given the unenviable
Possible Duplicate: Is there a good reason to use upper case for T-SQL keywords?

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.