PHP Language | 10 Minute‐Test 10


Instruction

  • Total number of questions : 10.
  • Time alloted : 10 minutes.
  • Each question carry 1 mark.
  • No Negative marks
  • DO NOT refresh the page.
  • All the best :-).

1.

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

A.
Abstract
B.
Protected
C.
Final
D.
Static

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

None.

2.

Which of the following advanced OOP features is/are not supported by PHP?
i) Method overloading
ii) Multiple Inheritance
iii) Namespaces
iv) Object Cloning

A.
All of the mentioned
B.
None of the mentioned
C.
i) and ii)
D.
iii) and iv)

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

The advanced OOP features are: Object cloning, Inheritance, Interfaces, Abstract classes, and Namespaces.

3.

How many error levels are available in PHP?

A.
14
B.
15
C.
16
D.
17

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

None.

4.

Which version of PHP was added with Exception handling?

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

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

Exception handling was added to PHP with the version 5 release, and further enhanced with version 5.3.

5.

Which of the following is/are an external data?
i) Cookies
ii) Input data from a form
iii) Server Variables
iv) Web services data

A.
Only ii)
B.
ii) and iii)
C.
None of the mentioned
D.
All of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

None

6.

PHP has long supported two regular expression implementations known as ___ and ___.
i) Perl
ii) PEAR
iii) Pearl
iv) POSIX

A.
i) and ii)
B.
ii) and iv)
C.
i) and iv)
D.
ii) and iii)

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

none

7.

How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.

A.
7
B.
8
C.
9
D.
10

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

The functions are preg_filter(), preg_grep(), preg_match(), preg_match_all(), preg_quote(), preg_replace(), preg_replace_callback(), and preg_split().

8.

The filesize() function returns the file size in ___.

A.
bits
B.
bytes
C.
kilobytes
D.
gigabytes

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

None

9.

What will be the output of the following PHP code?

    <?php

    echo (checkdate(4,31,2010) ? 'Valid' : 'Invalid');

    ?>

A.
TRUE
B.
FALSE
C.
Valid
D.
Invalid

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

April has 30 days and the above date is 31 therefore Invalid is returned.

10.

How many methods does the DateTime class have?

A.
8
B.
9
C.
10
D.
11
Submit your test now to view the Results and Statistics with answer explanation.