PHP MCQ Quiz Hub

PHP Mcq Set 4

Choose a topic to test your knowledge and improve your PHP skills

Which one of the following lines need to be uncommented or added in the php.ini file so as to enable mysqli extension?





✅ Correct Answer: 1

In which version of PHP was MySQL Native Driver(also known as mysqlnd) introduced?





✅ Correct Answer: 4

Which one of the following statements is used to create a table?





✅ Correct Answer: 1

Which one of the following statements instantiates the mysqli class?





✅ Correct Answer: 2

Which one of the following methods can be used to diagnose and display information about a MySQL connection error?





✅ Correct Answer: 3

Which method returns the error code generated from the execution of the last MySQL function?





✅ Correct Answer: 1

If there is no error, then what will the error() method return?





✅ Correct Answer: 3

Which one of the following statements should be used to include a file?





✅ Correct Answer: 2

Which one of the following methods is responsible for sending the query to the database?





✅ Correct Answer: 4

Which one of the following methods recuperates any memory consumed by a result set?





✅ Correct Answer: 2

Which of the methods are used to manage result sets using both associative and indexed arrays?





✅ Correct Answer: 4

Which one of the following method is used to retrieve the number of rows affected by an INSERT, UPDATE, or DELETE query?





✅ Correct Answer: 4

Which version of MySQL introduced the prepared statements?





✅ Correct Answer: 2

Which of the following methods is used to execute the statement after the parameters have been bound?





✅ Correct Answer: 1

Which one of the following methods is used to recuperating prepared statements resources?





✅ Correct Answer: 3

Which method retrieves each row from the prepared statement result and assigns the fields to the bound results?





✅ Correct Answer: 4

Which method rolls back the present transaction?





✅ Correct Answer: 3

Which one of the following is not a valid class name?





✅ Correct Answer: 4

Fill in the blank with the best option. An Object is a/an ________ of a class.





✅ Correct Answer: 3

Which version of PHP introduced the visibility keywords i.e public, private, and protected?





✅ Correct Answer: 2

Which characters is used to access property variables on an object-by-object basis?





✅ Correct Answer: 3

Code that uses a class, function, or method is often described as the ____





✅ Correct Answer: 1

Which keyword precedes a method name?





✅ Correct Answer: 2

If you omit the visibility keyword in your method declaration, by default the method will be declared as _____





✅ Correct Answer: 1

Which function is used to determine whether the variables value is either TRUE or FALSE?





✅ Correct Answer: 4

Which version of PHP introduced class type hints?





✅ Correct Answer: 3

Inheritance is the means by which one or more classes can be derived from a/an ___________ class.





✅ Correct Answer: 1

What should be used to refer to a method in the context of a class rather than an object you use?





✅ Correct Answer: 4

Prior to which version of PHP did constructors took the name of the enclosing class.





✅ Correct Answer: 2

Which method or property can only be accessed from within the enclosing class? Even subclasses have no access.





✅ Correct Answer: 3

A mutator method is also called as ___________





✅ Correct Answer: 1

PHP stands for -





✅ Correct Answer: 1

Who is known as the father of PHP?





✅ Correct Answer: 3

Variable name in PHP starts with -





✅ Correct Answer: 2

Which of the following is the default file extension of PHP?





✅ Correct Answer: 1

Which of the following is not a variable scope in PHP?





✅ Correct Answer: 1

Which of the following is correct to add a comment in php?





✅ Correct Answer: 4

Which of the following is used to display the output in PHP?





✅ Correct Answer: 4

Which of the following is the use of strlen() function in PHP?





✅ Correct Answer: 2

Which of the following is the use of strpos() function in PHP?





✅ Correct Answer: 3

Which of the following starts with __ (double underscore) in PHP?





✅ Correct Answer: 3

Which of the following is the correct way to create a function in PHP?





✅ Correct Answer: 3

What does PEAR stands for?





✅ Correct Answer: 1

Which of the following PHP function is used to generate unique id?





✅ Correct Answer: 3

Which of the following is the correct way of defining a variable in PHP?





✅ Correct Answer: 2

Which of the following is the correct use of the strcmp() function in PHP?





✅ Correct Answer: 4

What is the use of fopen() function in PHP?





✅ Correct Answer: 3

What is the use of isset() function in PHP?





✅ Correct Answer: 1

What is the use of sprintf() function in PHP?





✅ Correct Answer: 2