PS Exam

  • Full Screen
  • Wide Screen
  • Narrow Screen
  • Increase font size
  • Default font size
  • Decrease font size

PHP - Multiple Choice Questions (MCQs) - Objective Questions Set 3

E-mail Print PDF

Following are the Multiple Choice Questions (MCQs) or Objective Questions from PHP (PHP: Hypertext Preprocessor)

Set - 3

 This set contains 20 objective questions with 4 options each. The correct answer is provided at the end of the page.


 

1.  Trace the odd data type

a.  floats

b.  integer

c.  doubles

d.  Real number

2.  Which of the folowing are valid float values?

a.  4.5678

b.  4.0

c.  7e4

d.  All of above

3.  In php string data are

a.  delimited by single quote

b.  delimited by double quote

c.  delimited by <<< identifier

d.  All of above

4.  Which of the following delimiting method is known as string Interpolation

a.  delimited by single quote

b.  delimited by double quote

c.  delimited by <<< identifier

d.  All of above

5.  Which datatypes are treaded as arrays

a.  Integer

b.  Float

c.  String

d.  Booleans

6.  Which of following are compound data type?

a.  Array

b.  Objects

c.  Both

d.  None

7.  Casting operator introduced in PHP 6 is

a.  (array)

b.  (int64)

c.  (real) or (double) or (float)

d.  (object)

8.  When defining identifier in PHP you should remember that

a.  Identifier are case sensitive. So $result is different than $ result

b.  Identifiers can be any length

c.  Both of above

d.  None of above

9.  Identify the invalid identifier

a.  my-function

b.  size

c.  –some word

d.  This&that

10. Which of folowiing variable assignment is 'by value' assignment in PHP

a.  $value1= $value?

b.  $value1= & $value?

c.  $value1= & $value?

d.  None

11. Identify the variable scope that is not supported by PHP

a.  Local variables

b.  Function parameters

c.  Hidden variables

d.  Global variables

12. The output of ofllowing script would be

$somerar=15;

function ad it () {

GLOBAL $somevar;

$somerar++ ;

echo "somerar is $somerar";

}

addit ();

a.  somerar is 15

b.  somerar is 16

c.  somerar is 1

d.  somerar is $ somerar

13. Variable scope on which a variable does not loose its value when the function exists and use that value if the function is called again is:

a.  Local

b.  function parameter

c.  static

d.  None of above

14. The left association operator % is used in PHP for

a.  percentage

b.  bitwise or

c.  division

d.  modulus

15. The left associative dot operator (.) is used in PHP for

a.  multiplication

b.  concatenation

c.  separate object and its member

d.  delimeter

16. Trace the false statement

a.  Any code found within an included file will inherit the variable scope of the location of its caller

b.  Because the included code will be embedded in a PHP execution block, the PHP execution block, the PHP escape tags (<?php?>Wink aren't required on the file to be included

c.  For the inclusion of remote files the allow-url-pope must be enabled ad URL wrapper must be supported

d.  Including a file produces the same result as copying the data from the file specified into the location in which the statement appears.

17. Which of the following functions require the allow-url-fopen must be enabled?

a.  include()

b.  require()

c.  both of above

d.  None of above

18. Which function includes the specified file even the statement evaluates to false in which block the function is placed.

a.  include ()

b.  require ()

c.  both of above

d.  None of above

19. On failure of which statement the script execution stops displaying error/warning message?

a.  rinclude ()

b.  require ()

c.  both of above

d.  None of above

20. Trace the function that does continue the script execution even if the file inclusion fails

a.  include ()

b.  require ()

c.  both of above

d.  None of above

 



 

 

Answers:



1.  Trace the odd data type

b.  integer

2.  Which of the folowing are valid float values?

d.  All of above

3.  In php string data are

d.  All of above

4.  Which of the following delimiting method is known as string Interpolation

c.  delimited by <<< identifier

5.  Which datatypes are treaded as arrays

c.  String

6.  Which of following are compound data type?

c.  Both

7.  Casting operator introduced in PHP 6 is

b.  (int64)

8.  When defining identifier in PHP you should remember that

c.  Both of above

9.  Identify the invalid identifier

d.  This&that

10. Which of folowiing variable assignment is 'by value' assignment in PHP

a.  $value1= $value2

11. Identify the variable scope that is not supported by PHP

c.  Hidden variables

12. The output of ofllowing script would be

$somerar=15;

function ad it () {

GLOBAL $somevar;

$somerar++ ;

echo "somerar is $somerar";

}

addit ();

b.  somerar is 16

13. Variable scope on which a variable does not loose its value when the function exists and use that value if the function is called again is:

c.  static

14. The left association operator % is used in PHP for

d.  modulus

15. The left associative dot operator (.) is used in PHP for

b.  concatenation

16. Trace the false statement

b.  Because the included code will be embedded in a PHP execution block, the PHP execution block, the PHP escape tags (<?php?>Wink aren't required on the file to be included

17. Which of the following functions require the allow-url-fopen must be enabled?

c.  both of above

18. Which function includes the specified file even the statement evaluates to false in which block the function is placed.

b.  require ()

19. On failure of which statement the script execution stops displaying error/warning message?

b.  require ()

20. Trace the function that does continue the script execution even if the file inclusion fails

a.  include ()

 


 

Composed and Presented for PS Exam

 

 

 

Subscribe

Wish to get contents in your Email?

Enter your email address:

Who's Online

We have 45 guests online

Sharing Enriches!

You are here: MCQ Bank php PHP - Multiple Choice Questions (MCQs) - Objective Questions Set 3