MCQs > IT & Programming > PHP 5 > On compilation. the following PHP 7.1 code was supposed to produce the output 24. the code lines with errors. 1. 2. 3. class example 4- { 5. public $foo; G. 7. public function__construct()[ 8. $this->function = foo()[ 9. return 24; 10. }; 11. } 12. } 13. $exp = new example(]: 14. echo ($cxp->function)(). PHP_EOL;

PHP 5 MCQs

On compilation. the following PHP 7.1 code was supposed to produce the output 24.

the code lines with errors.


1.

2.

3. class example

4- {

5. public $foo;

G.

7. public function__construct()[

8. $this->function = foo()[

9. return 24;

10. };

11. }

12. }

13. $exp = new example(]:

14. echo ($cxp->function)(). PHP_EOL;


Answer

Correct Answer:

Line 8

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