Hello Everyone...!!!
There are more then 200 PHP interview questions for PHP developers to improve their web development skills and prepare for interviews.
Que.1 Which of the following statements invoke the exception class?
a) throws new Exception();
b) throw new Exception();
c) new Exception();
d) new throws Exception();
Que.2 Which one of the following is the right description for the method getMessage() ?
a) Returns the message if it is passed to the constructor.
b) Returns the message if it is passed to the class.
c) Returns the message if it is passed to the file.
d) Returns the message if it is passed to the object.
Que.3 You can extend the exception base class, but you cannot override any of the preceding methods because the are declared as..
a) protected
b) final
c) static
d) private
Que.4 What does SPL stand for?
a) Standard PHP Library
b) Source PHP Library
c) Standard PHP List
d) Source PHP List
Que.5 How many predefined exceptions does SPL provide access to?
a) 13
b) 14
c) 15
d) 16
Que.1 Which variable is used to collect form data sent with both the GET and POST methods?
a)$BOTH
b)$_BOTH
c)$REQUEST
d)$_REQUEST
Que.2 Which one of the following should not be used while sending passwords or other sensitive information?
a) GET
b) POST
c) REQUEST
d) NEXT
Que.3 Which function is used to remove all HTML tags from a string passed to a form?
a) remove_tags()
b) strip_tags()
c) tags_strip()
d) tags_remove()
Que.4 What will be the value of the variable $input in the following PHP code?
a) Swapna Lawrence you are really pretty!
b) Swapna
Lawrence
you are reallypretty!
c) Swapna
Lawrence
you are really pretty!
d) Swapna Lawrence you are reallypretty!
Que.5 To validate an e-mail address, which flag is to be passed to the function filter_var()?
a) FILTER_VALIDATE_EMAIL
b) FILTER_VALIDATE_MAIL
c) VALIDATE_EMAIL
d) VALIDATE_MAIL
Que.1 If one intends to create a model that will be assumed by a number of closely related objects, which class must be used?
a) Normal class
b) Static class
c) Abstract class
d) Interface
Que.2 If your object must inherit behavior from a number of sources you must use a/an
a) Interface
b) Object
c) abstract class
d) static class
Que.3 Which method is used to tweak an object’s cloning behavior?
a) clone()
b) __clone()
c) _clone
d) object_clone()
Que.4 Which feature allows us to call more than one method or function of the class in single instruction?
a) Typecasting
b) Method Including
c) Method adding
d) Method chaining
Que.5 Which magic method is used to implement overloading in PHP?
a) __call
b) __invoke
c) __wakeup
d) __unset
There are more then 200 PHP interview questions for PHP developers to improve their web development skills and prepare for interviews.
Questions :
Exception handling
Que.1 Which of the following statements invoke the exception class?
a) throws new Exception();
b) throw new Exception();
c) new Exception();
d) new throws Exception();
Que.2 Which one of the following is the right description for the method getMessage() ?
a) Returns the message if it is passed to the constructor.
b) Returns the message if it is passed to the class.
c) Returns the message if it is passed to the file.
d) Returns the message if it is passed to the object.
Que.3 You can extend the exception base class, but you cannot override any of the preceding methods because the are declared as..
a) protected
b) final
c) static
d) private
Que.4 What does SPL stand for?
a) Standard PHP Library
b) Source PHP Library
c) Standard PHP List
d) Source PHP List
Que.5 How many predefined exceptions does SPL provide access to?
a) 13
b) 14
c) 15
d) 16
HTML Forms
Que.1 Which variable is used to collect form data sent with both the GET and POST methods?
a)$BOTH
b)$_BOTH
c)$REQUEST
d)$_REQUEST
Que.2 Which one of the following should not be used while sending passwords or other sensitive information?
a) GET
b) POST
c) REQUEST
d) NEXT
Que.3 Which function is used to remove all HTML tags from a string passed to a form?
a) remove_tags()
b) strip_tags()
c) tags_strip()
d) tags_remove()
Que.4 What will be the value of the variable $input in the following PHP code?
$input = "SwapnaLawrence you are reallypretty!";
$input = strip_tags($input,"");
?>
b) Swapna
Lawrence
you are reallypretty!
c) Swapna
Lawrence
you are really pretty!
d) Swapna Lawrence you are reallypretty!
Que.5 To validate an e-mail address, which flag is to be passed to the function filter_var()?
a) FILTER_VALIDATE_EMAIL
b) FILTER_VALIDATE_MAIL
c) VALIDATE_EMAIL
d) VALIDATE_MAIL
Advanced Object-Oriented PHP
Que.1 If one intends to create a model that will be assumed by a number of closely related objects, which class must be used?
a) Normal class
b) Static class
c) Abstract class
d) Interface
Que.2 If your object must inherit behavior from a number of sources you must use a/an
a) Interface
b) Object
c) abstract class
d) static class
Que.3 Which method is used to tweak an object’s cloning behavior?
a) clone()
b) __clone()
c) _clone
d) object_clone()
Que.4 Which feature allows us to call more than one method or function of the class in single instruction?
a) Typecasting
b) Method Including
c) Method adding
d) Method chaining
Que.5 Which magic method is used to implement overloading in PHP?
a) __call
b) __invoke
c) __wakeup
d) __unset
Answersheet of these Questions will be available Tomorrow
Want more Questions....??? CLICK THE LINKS BELOW
PHP Multiple choice questions and answers-1
PHP Multiple choice questions and answers-2
PHP Multiple choice questions and answers-3
PHP Multiple choice questions-4
PHP Multiple choice questions and answers-8
PHP Multiple choice questions and answers-2
PHP Multiple choice questions and answers-3
PHP Multiple choice questions-4
0 comments:
Post a Comment