nerdexam
Zend

200-710 · Question #20

What is the output of the following code? $first = "second"; $second = "first"; echo $$$first;

The correct answer is B. "second". See the full explanation below for the reasoning.

PHP Basics

Question

What is the output of the following code? $first = "second"; $second = "first"; echo $$$first;

Options

  • A"first"
  • B"second"
  • Can empty string
  • Dan error

How the community answered

(25 responses)
  • A
    4% (1)
  • B
    84% (21)
  • C
    8% (2)
  • D
    4% (1)

Topics

#variable variables#dynamic variables#variable indirection#$$

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice