PHP 13

Lets Crack Online Exam

IT Interview Exam Paper: PHP 13

Subject: PHP 13

Part 13: List for questions and answers of PHP


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

a) ->ShopProduct

b) ->Shopproduct

c) ->Shopproduct1

d) 1shopproduct


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

a) ->type

b) ->prototype

c) instance

d) ->object


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

a) PHP 4

b) PHP 5

c) PHP 5.1

d) PHP 5.3


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

a) ::

b) =

c) ->

d) .


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

a) client code

b) user code

c) object code

d) class code


Q6. Which keyword precedes a method name?

a) method

b) function

c) public

d) protected 


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

a) public

b) private

c) protected

d) friendly


Q8. Which function is used to determine whether the variable’s value is either TRUE or


a) boolean()

b) is_boolean()

c) bool()

d) is_bool()


Q9. Which version of PHP introduced class type hints?

a) PHP 4

b) PHP 4.3

c) PHP 5

d) PHP 5.3


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

a) base

b) abstract

c) null

d) predefined


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

a) ->

b) __

c) $

d) ::


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

a) PHP 4

b) PHP 5

c) PHP 5.3

d) PHP 5.4 


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

a) public

b) friendly

c) private

d) protected


Q14. A mutator method is also called as..

a) Setter

b) Accessor

c) Getter

d) Destructor


Q15. When you are building administrative links you’ll need to accept two arguments, which of the following are they?

a) URL of previous entry and URL of the entry you are working with

b) The current page and previous page

c) URL of previous entry and previous page

d) The current page and URL of the entry you are working withv


Q16. Once your application can generate administrative links, you need to load those links into ___.

a) php.ini

b) index.ini

c) index.php

d) start.php


Q17. The URLs in the administrative links won’t mean anything to admin.php unless you modify ___.

a) .htaccess

b) .adminaccess

c) .htmlaccess

d) .urlaccess


Q18. The (|/) tells the server to match ___.

a) nothing

b) forward slash

c) backward slash

d) either nothing or a forward slash 


Q19. ([\w-]+) will match ___.

a) one word characters

b) one or more word characters

c) one or more word characters and/or hypens

d) one or more word characters and hypens


Q20. To declare the function to confirm the deletion you need to add the code to ___.

a) inc.php


c) include.php

d) functions.include.php 


Part 13: List for questions and answers of PHP


Q1. Answer:


Q2. Answer:


Q3. Answer: b


Q4. Answer: c


Q5. Answer: a


Q6. Answer: b


Q7. Answer: a


Q8. Answer: d


Q9. Answer: c


Q10. Answer: a


Q11. Answer: d


Q12. Answer:


Q13. Answer: c


Q14. Answer: a


Q15. Answer:


Q16. Answer: c


Q17. Answer: a


Q18. Answer: d


Q19. Answer: c


Q20. Answer: b