PHP Data Types MCQs

PHP Data Types MCQs : This section focuses on "Data Types" in PHP. These Multiple Choice Questions (mcq) should be practiced to improve the PHP skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.

1. How many different data types are available in php?

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

View Answer


2. How many compound data types are available in php?

A. 1
B. 2
C. 3
D. 4

View Answer


3. Which one is not a data type in PHP?

A. Resources
B. Objects
C. Null
D. Void

View Answer


4. The range of integers must lie between ___________?

A. -2^15 to 2^15.
B. -2^16 to 2^16.
C. -2^31 to 2^31.
D. -2^32 to 2^32.

View Answer


5. How many value does Boolean data type hold?

A. 1
B. 2
C. 3
D. 4

View Answer


6. Objects are defined as instances of user defined classes that can hold ____________?

A. values
B. functions
C. both values and functions
D. None of the above

View Answer


7. What will be the output of the following PHP code?

<?php 
  
if(TRUE) 
    echo "This condition is TRUE"; 
if(FALSE) 
    echo "This condition is not TRUE"; 
?>

A. This condition is TRUE
B. This condition is not TRUE
C. No Output
D. Error

View Answer


8. What will be the output of the following PHP code?

<?php 
$lfc = NULL; 
echo $lfc; 
?>

A. 0
B. Null
C. No Output
D. Error

View Answer


9. What will be the output of the following PHP code?

<?php 
$x1 = 10.58;  
$x2 = 21.18;  
  
$sum = $x1 + $x2; 
  
echo $sum; 
?>

A. 31
B. 32
C. 31.00
D. 31.76

View Answer


10. What will be the output of the following PHP code?

<?php 
$intArray = array( 10, 20 , 30); 
  
echo "First Element: $intArray[3]
"; 
?>

A. First Element: 10
B. First Element: 20
C. First Element: 30
D. First Element:

View Answer





Also check :


Discussion


* You must be logged in to add comment.