nerdexam
Zend

200-710 · Question #73

What is the output of the following code? $text = 'This is text'; $text1 = <<<TEXT TEXT; $text; $text2 = <<<TEXT $text1 TEXT; echo "$text2";

The correct answer is B. $text. See the full explanation below for the reasoning.

Strings & Patterns

Question

What is the output of the following code? $text = 'This is text'; $text1 = <<<TEXT TEXT; $text; $text2 = <<<TEXT $text1 TEXT; echo "$text2";

Options

  • AThis is text
  • B$text
  • C$text1
  • D$text2

How the community answered

(18 responses)
  • A
    17% (3)
  • B
    72% (13)
  • C
    6% (1)
  • D
    6% (1)

Topics

#heredoc#variable interpolation#string parsing#scope

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice