Time remaining
:
:
Test Status
PHPTEST10
Ques 1 :
Can i have new line in $subject tag of php mail function?
(A) Yes by specifying /n
(B) No
Ques 2 :
Question #10: How do we access the value of 'c' later?
$a = array(
'a',
3 => 'b',
'c'
);
(A) $a[0]
(B) $a[1]
(C) $a[2]
(D) $a[3]
Ques 3 :
What will be displayed in a browser when the following PHP code is executed:
<?php
function changeValue(&$y) {
$y = $y + 5;
}
$myNumber = 8;
changeValue($myNumber);
echo $myNumber;
?>
(A) 13
(B) 12
(C) 8
(D) None of the above
Ques 4 :
Which of the following is NOT a magic predefined constant?
(A) __FILE__
(B) __CLASS__
(C) __LINE__
(D) __DATE__
Ques 5 :
------------------ function in php returns a list of response headers send(or ready to send).
(A) headers_list()
(B) header()
(C) header_send()
(D) header_list()
Ques 6 :
What will be printed?
$a = array();
if ($a == null) {
echo 'true';
} else {
echo 'false';
}
(A) false
(B) true
Ques 7 :
What will be printed
if (null === false) {
echo 'true';
} else {
echo 'false';
}
(A) true
(B) false
(C) there is a syntax error
Ques 8 :
What joomla in php?
(A) An open source CMS.
(B) Set of library enriched with functions.
(C) Framework for designing dynamic pages.
(D) Framework and distribution system for reusable PHP components.
Ques 9 :
What is the output?
<?php
$RESULT = 11 + 011 + 0x11;
echo "$RESULT";
?>
(A) 37
(B) 33
(C) 22
(D) 11
Ques 10 :
What will be displayed in a browser when the following PHP code is executed:
<?php
$variable = 1;
switch ($variable) {
case 1:
echo "Hello World";
default:
echo "Hello RAM";
break;
}
?>
(A) Hello World
(B) Hello WorldHello RAM
(C) Hello RAM
(D) Nothing Will Be Displayed
Ques 11 :
Php support explicit type definition in variable declaration?
(A) False
(B) True
Ques 12 :
What will be the value of $var below?
$var = true ? '1' : false ? '2' : '3';
(A) 1
(B) 2
(C) 3
Ques 13 :
How can I create php array in a html<form>?
">(A) < input ="MyArray[]" />
(B) < input name= MyArray[]/>
">(C) < input name="MyArray[]" />
(D) < input MyArray[] />
Ques 14 :
What will be printed?
if ('2' == '02') {
echo 'true';
} else {
echo 'false';
}
(A) True
(B) False
Ques 15 :
What will be displayed in a browser when the following PHP code is executed:
<?php
for ($counter = 20; $counter < 10; $counter++){
echo "Hello Rohan";
}
echo "Counter is: $counter";
?>
(A) Hello Rohan Counter is: 22
(B) Hello Rohan
(C) Counter is: 20
(D) Hello Rohan Hello Rohan Counter is: 22
Ques 16 :
What will be printed?
$var = 'a';
$VAR = 'b';
echo "$var$VAR";
(A) aa
(B) bb
(C) ab
(D) ba
Ques 17 :
Parent constructer are not called-------------------------if the child class defines a constructer.
(A) implicitly
(B) explicitly
Ques 18 :
What will be displayed in a browser when the following PHP code is executed:
<?php
for ($counter = 15; $counter != 10; $counter--){
echo "Hello ";
}
?>
(A) Hello Hello
(B) Hello Hello Hello
(C) Hello Hello Hello Hello
(D) Hello Hello Hello Hello Hello
Ques 19 :
What is the output?
$a = array(
null => 'a',
true => 'b',
false => 'c',
0 => 'd',
1 => 'e',
'' => 'f'
);
echo count($a), "\n";
(A) 2
(B) 3
(C) 4
(D) 5
Ques 20 :
What gets printed?
class MyException extends Exception {}
try {
throw new MyException('Oops!');
} catch (Exception $e) {
echo "Caught Exception\n";
} catch (MyException $e) {
echo "Caught MyException\n";
}
(A) Caught Exception
(B) Caught MyException
Submit Answer
Don't Refresh the Page !! ...