Q. Which PHP constant returns the size of an integer in bytes?

  • (A) INT_SIZE
  • (B) SIZE_INT
  • (C) INTSIZE
  • (D) PHP_INT_SIZE
πŸ’¬ Discuss
βœ… Correct Answer: (D) PHP_INT_SIZE

Q. Which is/are the function(s) to check if the type of a variable is integer?

  • (A) is_int()
  • (B) is_integer()
  • (C) is_long()
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

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

Code:
<?php
$x = -123.45;
echo var_dump(is_int($x));
?>
  • (A) bool(false)
  • (B) bool(true)
  • (C) false
  • (D) true
πŸ’¬ Discuss
βœ… Correct Answer: (A) bool(false)

Q. Which is/are the function(s) to check if the type of a variable is float?

  • (A) is_float()
  • (B) is_double()
  • (C) is_longfloat()
  • (D) Both A and B
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both A and B

Q. Which is/are the function(s) to check if a numeric value is finite or infinite?

  • (A) is_finite()
  • (B) is_infinite()
  • (C) is_inf()
  • (D) Both A and B
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both A and B

Q. PHP NaN stands for ____.

  • (A) not-a-number
  • (B) not-a-numerical
  • (C) nothing-a-number
  • (D) numeric-a-number
πŸ’¬ Discuss
βœ… Correct Answer: (A) not-a-number

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

Code:
<?php
echo var_dump(is_nan(10));
?>
  • (A) bool(false)
  • (B) bool(true)
  • (C) false
  • (D) true
πŸ’¬ Discuss
βœ… Correct Answer: (A) bool(false)

Q. Which is the correct syntax to cast float to integer?

  • (A) (int) float_variable
  • (B) int (float_variable)
  • (C) (int) (float_variable)
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) (int) float_variable

Q. Which PHP function is used to get the value of PI?

  • (A) php_pi()
  • (B) pivalue()
  • (C) pi()
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) pi()

Q. Which PHP functions are used to find the lowest and highest values from a list of arguments?

  • (A) minimum() and maximum()
  • (B) min() and max()
  • (C) find_min() and find_max()
  • (D) getmin() and getmax()
πŸ’¬ Discuss
βœ… Correct Answer: (B) min() and max()