Adblocker Detected

Adblocker

Quizack provides Online Quiz and Practice MCQs for Free. Please disable your Ad-Blocker so we can earn from ads and keep this project alive.

PHP 5 Quiz PHP 5 Skill Assessment

Quizack provides PHP 5 MCQ practice question answers in an interactive format.

PHP 5 MCQ

Learn and practice your skills with our MCQ question answers to improve your knowledge. MCQs list

Start Practice with MCQs

PHP 5 Online Quiz

Quizack 10 minutes test will assess your knowledge and give you comprehensive results along feedback.

Start Quiz

PHP 5 PDF Download

Download Free PHP 5 MCQ questions answers PDF to practice and learn while are offline.

Download PDF

 

Used by 100s of Jobseekers and students

Used by 100s of Jobseekers and students

Focused questions for skill assessment

Focused questions for skill assessment

Premium questions with correct answers

Premium questions with correct answers

Related Skill Assessment

Free Sample Questions for PHP 5

What will be the output of the following PHP 7.1 code snippet?

<?php

function xrange($first, $last, $forward = 1)

{ if ($first < $last) {

if ($forward <= 0) {

throw new LogicException('The value of forward should be positive');

}

for ($i = $first; $i <= $last; $i += $forward){

yield $i;

}

} else {

if ($forward >= 0) {

throw new LogicException('The value of forward should be negative');

}

for ($i = $first; $i >= $last; $i += $forward){

yield $i;

}

}

}

echo "\n";

echo 'Output is: ';

foreach (xrange(1, 7, 2) as $num) {

echo "$num";

}

?>


Output is: 1 2 3 4 5 6 7

Output is: 1 7 2

Output is: 1 3 5 7

Compilation error.

Answer:

Output is: 1 3 5 7


Which array syntax is incorrect?

array(1, 2, 3)

[1, 2, 3]

array(1 => 1, 2 => 2, 3 => 3)

array(1 = 1, 2 = 2, 3 = 3)

Answer:
array(1 = 1, 2 = 2, 3 = 3)