thumbnail

PHP Quiz for dummies #4

PHP Quiz for dummies #4
Quiz by textreader
Rate:
Last updated: March 15, 2024
You have not attempted this quiz yet.
First submittedMarch 15, 2024
Times taken4
Average score85.7%
Report this quizReport
5:00
The quiz is paused. You have remaining.
Scoring
You scored / = %
This beats or equals % of test takers also scored 100%
The average score is
Your high score is
Your fastest time is
Keep scrolling down for answers and more stats ...
1. Which of the below statements is equivalent to $num += $num
$num = $num;
$num = $num + 1;
$num = $num + $num;
$num = $num + $num + 1;
2. Which of the below symbols is a newline character ?
\n
/n
/t
\t
3. Which of the following function is used to locate a string within a string ?
strsearch()
search()
strpos()
locate()
4. Which statement will output $x on the screen ?
echo "$x;";
echo "$$x";
echo "\$x";
echo "/$x";
5. What will be executed from the code below? $a = 12; ($a == 12) ? 5 : 1
5
1
12
error
6. Which of the following function can be used to get an array in the reverse order ?
array_reverse()
array_split()
array_search()
array_shift();
7. Which function can be used to move the pointer to the previous array position ?
prev()
before()
last()
previous()
8. If your object must inherit behavior from a number of sources you must use a/an?
Dynamic class
Object
Interface
Static class
9. Which one of the following is the right way to invoke a method ?
$object::methodName();
$object->methodName();
object->methodName();
object::methodName();
10. Which one of the following keyword is used to inherit our subclass into a superclass ?
include
inherit
implements
extends
11. Which keyword allows class members (methods and properties) to be used without needing to instantiate a new instance of the class ?
private
static
public
protected
12. Which of the following statements is/are true about Constructors in PHP ?
Constructors can accept parameters.
Constructors can call class methods or other functions.
Class constructors can call on other constructors.
All of the Above
13. Which of the following method can be used to close a MySQL database using PHP ?
mysql_query()
mysql_connect()
mysql_close()
None of the above
14. Which of the following advanced OOP features is/are not supported by PHP ?
Multiple Inheritance
Method overloading
All of the Above
None of the above
Comments
No comments yet