nerdexam
Zend

200-530 · Question #465

You run the following PHP script: <?php class number { public $a= 10; public $b=20; private $c=30; } $numbers = new number(); foreach($numbers as $var => $value) { echo "$value "; } ?> What will be…

The correct answer is D. 10 20. See the full explanation below for the reasoning.

Question

You run the following PHP script: <?php class number { public $a= 10; public $b=20; private $c=30; } $numbers = new number(); foreach($numbers as $var => $value) { echo "$value "; } ?> What will be the output?

Options

  • A10 20 30
  • B10 20 0
  • CThe script will throw an error.
  • D10 20

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    13% (4)
  • C
    3% (1)
  • D
    80% (24)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice