Quiz Summary
0 of 25 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Results
Your time:
Time has elapsed
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- Current
- Review
- Answered
- Correct
- Incorrect
-
Question 1 of 25
1. Question
Array values are keyed by ______ values (called indexed arrays) or using ______ values (called associative arrays). Of course, these key methods can be combined as well.
-
Question 2 of 25
2. Question
What will the following script output?
<?php
$array = array (1, 2, 3, 5, 8, 13, 21, 34, 55);
$sum = 0;
for ($i = 0; $i < 5; $i++) {
$sum += $array[$array[$i]];
}
echo $sum;
?> -
Question 3 of 25
3. Question
What elements will the following script output?
<?php
$array = array (true => ‘a’, 1 => ‘b’);
var_dump ($array);
?> -
Question 4 of 25
4. Question
Which array function checks if the specified key exists in the array
-
Question 5 of 25
5. Question
There are three different kind of arrays:
-
Question 6 of 25
6. Question
Absent any actual need for choosing one method over the other, does passing arrays by value to a read-only function reduce performance compared to passing them by reference?
-
Question 7 of 25
7. Question
Assume you would like to sort an array in ascending order by value while preserving key associations. Which of the following PHP sorting functions would you use?
-
Question 8 of 25
8. Question
What function computes the difference of arrays?
-
Question 9 of 25
9. Question
What functions count elements in an array?
-
Question 10 of 25
10. Question
What array will you get if you convert an object to an array?
-
Question 11 of 25
11. Question
PHP’s numerically indexed array begin with position __.
-
Question 12 of 25
12. Question
Which of the functions is used to sort an array in descending order?
-
Question 13 of 25
13. Question
Which of the following are correct ways of creating an array?
(i) state[0] = “karnataka”;
(ii) $state[] = array(“karnataka”);
(iii) $state[0] = “karnataka”;
(iv) $state = array(“karnataka”); -
Question 14 of 25
14. Question
What will be the output of the following PHP code?
< ?php
$fruits = array (“mango”, “apple”, “pear”, “peach”);
$fruits = array_flip($fruits);
echo ($fruits[0]);
?> -
Question 15 of 25
15. Question
What will be the output of the following php code?
< ?php
$states = array(“karnataka” => array
( “population” => “11,35,000”, “captial” => “Bangalore”),
“Tamil Nadu” => array( “population” => “17,90,000”,
“captial” => “Chennai”) );
echo $states[“karnataka”][“population”];
?> -
Question 16 of 25
16. Question
What will be the output of the following PHP code ?
<?php
if (print “hi” – 1)
print “hello”
?> -
Question 17 of 25
17. Question
What will be the output of the following PHP code ?
<?php
$x = 1;
if ($x–)
print “hi”
$x–;
else
print “hello”
?> -
Question 18 of 25
18. Question
What will be the output of the following PHP code ?
<?php
$a = 10;
$b = 11;
if ($a < ++$a || $b < ++$b)
print “hello”;
else
print “hi”;
?> -
Question 19 of 25
19. Question
What will be the output of the following PHP code ?
<?php
$a = 2;
if ($a– – –$a – $a)
print “hello”;
else
print “hi”;
?> -
Question 20 of 25
20. Question
What will be the output of the following PHP code ?
<?php
$a = 2;
if ($a– – –$a – $a)
print “hello”;
else
print “hi”;
?><?php
$a = “hello”;
if ($a.length)
print $a.length;
else
print “hi”;
?> -
Question 21 of 25
21. Question
What will be the output of the following PHP code ?
<?php
$a = “hello”;
if (strlen($a))
print strlen($a);
else
print “hi”;
?> -
Question 22 of 25
22. Question
What will be the output of the following PHP code ?
<?php
$a = “1”;
$b = “0”;
if ((int)$a && $b)
print”hi”;
else
print “hello”;
?> -
Question 23 of 25
23. Question
What will be the output of the following PHP code ?
<?php
$a = “1”;
switch ($a)
{
case 1:
print “hi”;
case 2:
print “hello”;
default:
print “hi1”;
}
?> -
Question 24 of 25
24. Question
What will be the output of the following PHP code ?
<?php
$a = “2”;
switch ($a)
{
case 1:
print “hi”;
case 2:
print “hello”;
break;
default:
print “hi1”;
}
?> -
Question 25 of 25
25. Question
What will be the output of the following PHP code ?
<?php
$a = “1”;
switch($a)
{
case 1:
break;
print “hi”;
case 2:
print “hello”;
break;
default:
print “hi1”;
}
?>