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

  • SEARCH
  • Home
  • 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 8238597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:52:10+00:00 2026-06-07T19:52:10+00:00

I was wondering whether: $foo = <<< EOT Hello, World! EOT; is just as

  • 0

I was wondering whether:

$foo = <<< EOT
Hello, World!
EOT;

is just as valid as

$foo = <<<EOT
Hello, World!
EOT;

and in particular whether this is true in all versions of PHP (or just the latest ones).

I wonder because I want to know whether a space between the <<< and first EOT identifier is syntactically valid. For instance, my PHP interpreter 5.3.10 runs this correctly but
my vim text editor does not syntax-highlight the heredoc in the same way if there is a
space between <<< and EOT (the EOT identifier is colored white instead of purple).

So what is the deal here? Are both legal in all versions of PHP or not?

  • 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. Editorial Team
    Editorial Team
    2026-06-07T19:52:11+00:00Added an answer on June 7, 2026 at 7:52 pm

    No, you should not provide a space between the <<< and the identifier. As specified in the PHP documentation:

    (…) the identifier must follow the same naming rules as any other label in PHP: it must contain only alphanumeric characters and underscores, and must start with a non-digit character or underscore.

    Source: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wondering whether anyone knows how to get blogger labels into alt tags in
I'm wondering whether this bit of code is exhibiting the correct C++ behaviour? class
Im wondering whether this snippet of code will actually store a pointer pointing to
I was wondering whether search engines respect the HTTP header field Content-Location . This
I've been wondering whether this shorthand, if we may call it that, is an
Just wondering whether it is possible to update a ByteArray in C Code, which
Just wondering whether there is a way to insert a bulk text message into
Hi just wondering whether or not to add a pull to refresh in my
I am wondering whether I can use the this keyword inside a C# lambda,
Just wondering whether anyone knows what events an HTML5 <input type=number /> element fires

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.