MCQs > IT & Programming > PHP 5 > Object iteration. class A { public $v1 = 'a'; protected $v2 = 'b'; private $v3 = 'c'; var $v4 = 'd'; } $a = new A(); foreach ($a as $k => $v) { echo '$k => $v\n'; } What is the output of the foreach loop?

PHP 5 MCQs

Object iteration. class A { public $v1 = 'a'; protected $v2 = 'b'; private $v3 = 'c'; var $v4 = 'd'; } $a = new A(); foreach ($a as $k => $v) { echo "$k => $v\n"; } What is the output of the foreach loop?

Answer

Correct Answer: v1 => a v4 => d

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PHP 5 Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP 5 Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it