Verifone Previous Years Solved Sample Placement Papers
-
In the following PHP program, what is/are the properties?
A. function sample()
B. echo “This is an example”;
C. public $name; Answer: Option C
D. class Example
-
Explanation: Above code is an example of ‘classes’. Classes are the blueprints of objects. Classes are the programmer-defined data type, which includes the local methods and the local variables. Class is a collection of objects which has properties and behavior.
-
What will be the output of the following PHP code?
A. $GREETING
B. no output Answer: Option B
C. PHP is a scripting language
D. GREETING
-
Explanation: Constants do not need a $ before them, they are referenced by their variable names itself.
-
A function in PHP which starts with __ (double underscore) is known as __________
A. Default Function
B. User Defined Function
C. Inbuilt Function
D. Magic Function Answer: Option D
-
Explanation: PHP functions that start with a double underscore – a “__” – are called magic functions. They are functions that are always defined inside classes, and are not stand-alone functions.
-
Which of the following pair have non-associative equal precedence?
A. +, -
B. ==, != Answer: Option B
C. +, /
D. &=, |=
-
Which of the following functions output text?
A. echo()
B. print()
C. Both A, B Answer: Option C
D. display()
-
Which of the following statement is not correct for PHP?
A. It is a server-side scripting language
B. A PHP file may contain text, HTML tags, or scripts
C. It can run on Windows and Linux systems only Answer: Option C
D. It is compatible with most of the common servers used today
-
Which of the following printing construct/function accepts multiple parameters?
A. echo Answer: Option A
B. print
C. printf
D. All of the above
-
What will be the output of the following code?
$a = 10;
if ($a > 5 OR < 15)
echo 'true';
else
echo 'false';
A. true
B. false
C. No output
D. Parse Error Answer: Option D
-
Which of the following variable names are invalid?
A. $var_1
B. $var1
C. $var-1
D. $var/1
E. Both C, D Answer: Option E
-
What will be the output of the following code?
$a = 10;
echo 'Value of a = $a';
A. Value of a = 10
B. Value of a = $a Answer: Option B
C. Undefined
D. Syntax Error
-
What will be the output of the following code?
$Rent = 250;
function Expenses($Other) {
$Rent = 250 + $Other;
return $Rent;
}
Expenses(50);
echo $Rent;
A. 300
B. 250 Answer: Option B
-
Which of the following pair have non-associative equal precedence?
A. +, -
B. ==, != Answer: Option B
C. +, /
D. &=, |=
-
Which of the following functions output text?
A. echo()
B. print()
C. Both A, B Answer: Option C
D. display()
-
Which of the following statement is not correct for PHP?
A. It is a server-side scripting language
B. A PHP file may contain text, HTML tags, or scripts
C. It can run on Windows and Linux systems only Answer: Option C
D. It is compatible with most of the common servers used today
-
Which of the following printing construct/function accepts multiple parameters?
A. echo Answer: Option A
B. print
C. printf
D. All of the above
-
What will be the output of the following code?
$a = 10;
if ($a > 5 OR < 15)
echo 'true';
else
echo 'false';
A. true
B. false
C. No output
D. Parse Error Answer: Option D
-
Which of the following variable names are invalid?
A. $var_1
B. $var1
C. $var-1
D. $var/1
E. Both C, D Answer: Option E
-
What will be the output of the following code?
$a = 10;
echo 'Value of a = $a';
A. Value of a = 10
B. Value of a = $a Answer: Option B
C. Undefined
D. Syntax Error
-
What will be the output of the following code?
$Rent = 250;
function Expenses($Other) {
$Rent = 250 + $Other;
return $Rent;
}
Expenses(50);
echo $Rent;
A. 300
B. 250 Answer: Option B