Home > PHP & Programming > Quizzes > Advanced PHP Practice Test
Advanced PHP Practice Test
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 66% Most missed: “Appending session data to an absolute URL does not represent a security risk.”
Advanced PHP Practice Test
Time left 00:00
25 Questions

1. Unlike constructors, you cannot pass information to a destructor, because you are never sure when its going to be run.
2. Once a class has been defined, objects can be created from the class with the ....... keyword.
3. A snapshot of the session data can be taken at any time and written out to a file.
4. PHP sessions are created using the . . . . . function.
5. session_destroy() erases all session variable.
6. In . . . . . constructors, it is important to remember that you have to call the parent constructor explicitly.
7. Constructor and destructor methods have no . . . . . . and are called automatically - they cannot be called explicitly and consequently their declarations need no access specifier.
8. What will happen at the end of the following sequence of SQL commands? BEGIN TRANSACTION DELETE FROM MYTABLE WHERE ID=1 DELETE FROM OTHERTABLE ROLLBACK TRANSACTION
9. SQL is not case sensitive. SELECT is the same as select.
10. A class may contain its own .............
11. If the php.ini register_globals directive is set, session data becomes available in the . . . . namespace.
12. strlen() returns the length of the string on success and . . . . if the string is empty.
13. . . . . . converts the keys of an array into values and the values into keys.
14. Even if you don’t delete the object yourself using . . . . . , PHP still calls the destructor when it determines that the object is no longer used.
15. usleep(1000000)
Above usleep() function pauses PHP for . . . .
16. Which of the following is not an SQL aggregate function?
17. The ............. statement is used to delete a table.
18. Child classes are defined using the keyword .....
19. The arguments in a function are evaluated from .....
20. Sessions allow you to
21. In PHP in order to access MySQL database you will use:
22. All PHP classes come with a default constructor that takes .... arguments.
23. $array = array(0, 1, 2)
$array = array_pad($array, -6, ‘NEW’)
Output will be:
24. . . . . . is a class which can only be instantiated once. You can effectively only have one object per . . . . . class in an application.
25. PHP makes it possible to automatically execute code when a new instance of a class is created, using a special class method called a ........