Chapter: Introduction to Object Oriented Programming in PHP
1.

Which method scope prevents a method from being overridden by a subclass?

A. Abstract
B. Protected
C. Final
D. Static
Answer» C. Final
2.

Which of the following statements are true is/are true about constructors in PHP?
(i) PHP 4 introduced class constructors.
(ii) Constructors can accept parameters.
(iii) Constructors can call class methods or other functions
(iv) Class constructors can call on other constructors.

A. All of the mentioned
B. None of the mentioned
C. only i
D. only ii
Answer» A. All of the mentioned
3.

PHP recognize constructors by the name.

A. class name()
B. _construct()
C. function _construct()
D. function __construct()
Answer» D. function __construct()
4.

Which version of PHP introduced the instance of keyword?

A. PHP 4
B. PHP 5
C. PHP 5.3
D. PHP 6
Answer» B. PHP 5
5.

Which one of the following functions is used to determine whether a class exists?

A. exist()
B. exist_class()
C. class_exist()
D. exist()
Answer» C. class_exist()
6.

Which one of the following functions is used to determine object type?

A. obj_type()
B. type()
C. is_a()
D. is_obj()
Answer» C. is_a()
7.

Which one of the following keyword is used to inherit our subclass into a superclass?

A. . extends
B. . implements
C. . inherit
D. . include
Answer» A. . extends
8.

Which keyword is used to refer to properties or methods within the class itself?

A. . private
B. public
C. protected
D. . $this
Answer» D. . $this
9.

Which keyword allows class members (methods and properties) to be used without needing to instantiate a new instance of the class?

A. protected
B. . final
C. static
D. private
Answer» C. static
10.

_________ is a blue print of any object in OOP.

A. class
B. object
C. Construct
D. Serializing
Answer» A. class
11.

An _____ is an instance or occurrence of our class.....

A. class
B. object
C. Construct
D. Serializing
Answer» B. object
12.

The _____ method starts with two underscores (__).

A. class
B. object
C. Construct
D. Serializing
Answer» C. Construct
13.

_______an object means converting it to a byte stream representation that can be stored into file.

A. class
B. object
C. Construct
D. Serializing
Answer» D. Serializing
14.

A class property used by another class is called ______.

A. Abstract class
B. Interface
C. Encapsulation
D. inheritance.
Answer» D. inheritance.
15.

_________is used to support multiple inheritance

A. Abstract class
B. Interface
C. Encapsulation
D. inheritance.
Answer» B. Interface
16.

The ability to hide the details of implementation is known as _____.

A. Abstract class
B. Interface
C. Encapsulation
D. inheritance.
Answer» C. Encapsulation
17.

An _______ is one that cannot be instantiated, only inherited

A. Abstract class
B. Interface
C. Encapsulation
D. inheritance.
Answer» A. Abstract class
18.

Constant name are proceeded by _____ like a normal variable declaration.

A. Abstract class
B. dollar sign($)
C. Encapsulation
D. inheritance.
Answer» B. dollar sign($)
19.

_______ is available when a method is called from within an object context

A. Abstract class
B. dollar sign($)
C. $this
D. inheritance.
Answer» C. $this
20.

in PHP, An _____is a special variable, which can hold more than one value at a time.

A. array
B. structure
C. csss
D. none of these
Answer» A. array
21.

In PHP, there are three types of arrays:

A. Indexed arrays -
B. Associative arrays -
C. Multidimensional arrays -
D. all of the above
Answer» D. all of the above
22.

in PHP ,The____ function is used to return the length (the number of elements) of an array:

A. count
B. min
C. abs
D. sqrt()
Answer» A. count
23.

The index can be assigned automatically (index always starts at 0), like this: $cars = array("Volvo", "BMW", "Toyota");

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
24.

The _____ functions can be used to find the lowest or highest value in a list of arguments:

A. count & num
B. min & max
C. abs & count
D. sqrt() & round
Answer» B. min & max
25.

The _____ function returns the absolute (positive) value of a number:

A. count
B. min
C. abs
D. sqrt()
Answer» C. abs
26.

the _____function returns the square root of a number:

A. count
B. min
C. abs
D. sqrt()
Answer» D. sqrt()
27.

The _____function rounds a floating-point number to its nearest integer:

A. round
B. min
C. abs
D. sqrt()
Answer» A. round
28.

The _______ function generates a random number:

A. rand
B. min
C. abs
D. sqrt()
Answer» A. rand
29.

To create a constant, use the _____ function.is used

A. define()
B. min()
C. abs()
D. sqrt()
Answer» A. define()
30.

In PHP7, you can create an Array constant using the ____ function.

A. define()
B. min()
C. abs()
D. sqrt()
Answer» A. define()
31.

The ____statement is used to perform different actions based on different conditions.

A. switch
B. min
C. abs
D. sqrt()
Answer» A. switch
32.

The PHP ____function formats a timestamp to a more readable date and time.

A. date()
B. min()
C. abs()
D. sqrt()
Answer» A. date()
33.

A ______is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values.

A. cookie
B. session
C. abs
D. sqrt
Answer» A. cookie
34.

A ______ is a way to store information (in variables) to be used across multiple pages.

A. cookie
B. session
C. abs
D. sqrt
Answer» B. session
35.

_______are the two main aspects of object-oriented programming.

A. classes and objects
B. constructor and destructor
C. object and array
D. none of these
Answer» A. classes and objects
36.

A ______allows you to initialize an object's properties upon creation of the object.

A. classes
B. constructor
C. object
D. none of these
Answer» B. constructor
37.

If you create a __construct() function, PHP will automatically call this function when you create an object from a class.

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
38.

A ______is called when the object is destructed or the script is stopped or exited.

A. destructor
B. constructor
C. object
D. none of these
Answer» A. destructor
39.

If you create a __destruct() function, PHP will automatically call this function at the end of the script.

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
Chapter: Web Techniques
40.

URL stands for ____________ .

A. Uniform resource locator
B. Universal resource location
C. Universe research land mark
D. non of theses
Answer» A. Uniform resource locator
41.

The __________ array contains information from the web server.

A. S_client
B. S_server
C. dynamic
D. non of these
Answer» B. S_server
42.

The _________ works through request header and response.

A. Authentication
B. Authority
C. Responsibility
D. none of these
Answer» A. Authentication
43.

_____________ is a php super global variable which is used to access global variable from anywhere in PHP script.

A. $_ localb
B. $_Global
C. Client
D. none of these
Answer» B. $_Global
44.

The size of file can be limited using _________ limit and _____________ limit.

A. soft and hard
B. little and short
C. mg and gb
D. none of these
Answer» A. soft and hard
45.

How do you create cookie in PHP by ________.

A. set-cookie()
B. create Cookie ()
C. make Cooking()
D. none of these
Answer» A. set-cookie()
46.

MYSQL i here "i" means________

A. implementation
B. interface
C. improved
D. none of these
Answer» C. improved
47.

Data source name in pear DB is _________

A. String
B. character
C. float
D. int
Answer» A. String
48.

Which are build in data types that sql supports?

A. real ,double precision
B. mysql
C. pear db
D. data
Answer» A. real ,double precision
49.

which type of language used in sql

A. DDL
B. DML
C. DIL
D. none of these
Answer» A. DDL
50.

java script was designed as a _____ scripting language.

A. get
B. Post
C. Server
D. Client
Answer» D. Client
51.

HTTP stands for ___________.

A. Hyper text transfer protocol
B. hyper text mark protocol
C. File transfer protocol
D. none of these
Answer» A. Hyper text transfer protocol
52.

Get and ________ are two HTTP methods that a client use to pass from data server.

A. get
B. Post
C. Server
D. Client
Answer» B. Post
53.

______ tag is used for multiple selections.

A. select tag
B. text tag
C. list tag
D. none of these
Answer» A. select tag
54.

To upload the file ________ array is used.

A. $Files
B. $load
C. $New
D. none of these
Answer» A. $Files
55.

PHP was designed as a ________ scripting language.

A. Sever side
B. client slide
C. compiler
D. none of these
Answer» A. Sever side
56.

____________is about communication between web clients and servers

A. WWW
B. HTML
C. TCP
D. FTP
Answer» A. WWW
57.

Communication between client computers and web servers is done by sending _________________.

A. HTTP request & HTTP Responses
B. GET & POST
C. TCP & FTP
D. none of these
Answer» A. HTTP request & HTTP Responses
58.

A ______is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the ________ too.

A. Cookie & cookie
B. FTP & TCP
C. GET & POST
D. HTTP request & HTTP Responses
Answer» A. Cookie & cookie
59.

_______ statements reduce parsing time as the preparation on the query is done only once (although the statement is executed multiple times)

A. Prepared
B. fetch
C. array
D. SSL
Answer» A. Prepared
60.

The MySQLi functions allows you to access______ database servers.

A. Mysql
B. SSL
C. Fetch
D. none of these
Answer» A. Mysql
61.

The____ function fetches a result row as an associative array, a numeric array, or both.

A. fetch array()
B. Cookie()
C. S_Array()
D. D_array()
Answer» A. fetch array()
62.

The ssl_set()function is used to establish secure connections using _____

A. secure socket layer (SSL)
B. Mysql
C. http
D. none of these
Answer» A. secure socket layer (SSL)
63.

__________ function is used to change the default database for the connection.

A. fetch_array()
B. Cookie()
C. S_Array()
D. mysqli_select_db()
Answer» D. mysqli_select_db()
64.

An inherited class is defined by using the ______ keyword.

A. extends
B. constructor
C. object
D. none of these
Answer» A. extends
65.

Abstract classes and methods are when the parent class has a named method, but need its child class(es) to fill out the tasks.

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
66.

An abstract class is a class that contains at least one abstract method. An abstract method is a method that is declared, but not implemented in the code.

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
67.

When inheriting from an abstract class, the child class method must be defined with the same name, and the same or a less restricted access modifier.

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
68.

Interfaces allow you to specify what methods a class should implement.

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
69.

Interfaces are declared with the ________ keyword:

A. interface
B. abstract class
C. implements
D. None of these
Answer» A. interface
70.

Interface are similar to abstract classes. The difference between interfaces and abstract classes are Interfaces cannot have properties, while abstract classes can have.

A. interface
B. abstract class
C. implements
D. None of these
Answer» A. interface
71.

To implement an interface, a class must use the______ keyword.

A. interface
B. abstract class
C. implements
D. None of these
Answer» C. implements
72.

In PHP, there are three types of arrays one is not type of array in php which one:

A. Indexed arrays -
B. Associative arrays -
C. Multidimensional arrays -
D. polygamy array
Answer» D. polygamy array
73.

An inherited class is defined by using the extends keyword.

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
74.

Classes and objects are the two main aspects of __________________

A. object oriented programming
B. constructor and destructor
C. object and array
D. none of these
Answer» A. object oriented programming
75.

A constructor allows you to initialize an object's properties upon creation of the object.

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
76.

If you create a _______function, PHP will automatically call this function when you create an object from a class.

A. __construct()
B. ___destruct()
C. both a and b
D. none of these
Answer» A. __construct()
77.

A destructor is called when the object is destructed or the script is stopped or exited.

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
78.

A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values.

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
79.

A session is a way to store information (in variables) to be used across multiple pages.

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
Chapter: DataBases
80.

Which one of the following databases has PHP supported almost since the beginning?

A. Oracle Database
B. SQL
C. SQL+
D. MySQL
Answer» D. MySQL
81.

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

A. CREATE TABLE table_name (column_namecolumn_type);
B. CREATE table_name (column_typecolumn_name);
C. . CREATE table_name (column_namecolumn_type);
D. . CREATE TABLE table_name (column_typecolumn_name);
Answer» A. CREATE TABLE table_name (column_namecolumn_type);
82.

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

A. errno()
B. . errnumber()
C. . errorno()
D. errornumber()
Answer» A. errno()
83.

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

A. . TRUE
B. . FALSE
C. . Empty String
D. . non of these
Answer» C. . Empty String
84.

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

A. . #include ‘filename’;
B. include ‘filename’;
C. include <filename>
D. none of these
Answer» B. include ‘filename’;
85.

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

A. destroy()
B. remover()
C. alloc()
D. free()
Answer» D. free()
86.

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

A. . connect_errno()
B. connect_error()
C. mysqli_connect_errno()
D. . mysqli_connect_error()
Answer» C. mysqli_connect_errno()
87.

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

A. get_row()
B. . fetch_row()
C. . fetch()
D. row()
Answer» C. . fetch()
88.

Which one of the Following methods is responsible for sending the query to Database

A. query()
B. send_query( )
C. sendquery()
D. query_send()
Answer» A. query()
89.

Which is the comment symbol in mysql?

A. &&
B. /*….*/
C. #
D. %
Answer» C. #
90.

A ________ consists of one or more tables.

A. database
B. command
C. Query
D. none of these
Answer» A. database
91.

________ is used to uniquely identify the rows in table.

A. primary key
B. Database
C. not null
D. none of these
Answer» A. primary key
92.

_____ returns the last error description for the most recent function call

A. Error no
B. Zero no
C. no error
D. none of these
Answer» A. Error no
93.

A _______ is a server that manages data for user.

A. Wamp
B. World
C. Excel
D. none of these
Answer» A. Wamp
94.

RDBMS stands for __________.

A. Relation data base management
B. reletives data base management
C. Random data base management
D. none of these
Answer» A. Relation data base management
95.

In PHP $Icon=mySQL_connect("localhost","root","") is used to ____ to the data base .

A. create
B. close
C. connect
D. none of these
Answer» C. connect
96.

mysql_close() is use to ________database(wamp) in php .

A. create
B. close
C. connect
D. none of these
Answer» B. close
97.

______ is use to create the web page .

A. Word press
B. Lotus
C. Word star
D. none of these .
Answer» A. Word press
98.

die(mySQL_error()) is used to show _______ message .

A. error
B. Connect
C. create
D. none of these
Answer» A. error
99.

The long form of SQL is __________.

A. Structural query language
B. Structural question language
C. System Query Language
D. None of these
Answer» A. Structural query language
100.

the switch statement is used to perform different actions based on different conditions

A. true
B. false
C. both a and b
D. none of these
Answer» A. true
Tags
Question and answers in Advanced Web Technologies, Advanced Web Technologies multiple choice questions and answers, Advanced Web Technologies Important MCQs, Solved MCQs for Advanced Web Technologies, Advanced Web Technologies MCQs with answers PDF download