Core Language & Types interview questions

24 real Core Language & Types questions from the PHP bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is Type juggling?

Junior
  1. A.PHP's automatic conversion of a value from one scalar type to another depending on the operator or context in which the value is used
  2. B.a per-file declare statement that turns off coercion of scalar arguments so a mismatched type throws a TypeError instead of being silently converted
  3. C.a three-way comparison written as less-than equals greater-than that returns -1, 0, or 1 depending on whether the left side is smaller, equal to, or larger than the right
  4. D.compares both value and type, returning true only when operands match without any coercion, written as a triple equals sign
Reveal the answer + AI explanation — free account

2. Which term means: "PHP's automatic conversion of a value from one scalar type to another depending on the operator or context in which the value is used"?

Junior
  1. A.Type juggling
  2. B.Scalar type declaration
  3. C.Null coalescing operator
  4. D.Strict types directive
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.Type juggling — PHP's automatic conversion of a value from one scalar type to another depending on the operator or context in which the value is used
  2. B.Type juggling — compares two operands for equal value after type coercion, written as a double equals sign
  3. C.Type juggling — a three-way comparison written as less-than equals greater-than that returns -1, 0, or 1 depending on whether the left side is smaller, equal to, or larger than the right
  4. D.Type juggling — returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices
Reveal the answer + AI explanation — free account

4. What is Identical operator?

Junior
  1. A.a hint such as int, float, string, or bool placed on a function parameter or return so the engine validates or coerces the passed value
  2. B.the version-8 fix where comparing a number with a non-numeric string now casts the number to string rather than the string to zero, so 0 equals the word foo is finally false
  3. C.compares both value and type, returning true only when operands match without any coercion, written as a triple equals sign
  4. D.returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices
Reveal the answer + AI explanation — free account

5. Which term means: "compares both value and type, returning true only when operands match without any coercion, written as a triple equals sign"?

Junior
  1. A.Strict types directive
  2. B.Identical operator
  3. C.Numeric string comparison change in PHP 8
  4. D.Scalar type declaration
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.Identical operator — PHP's automatic conversion of a value from one scalar type to another depending on the operator or context in which the value is used
  2. B.Identical operator — compares two operands for equal value after type coercion, written as a double equals sign
  3. C.Identical operator — a hint such as int, float, string, or bool placed on a function parameter or return so the engine validates or coerces the passed value
  4. D.Identical operator — compares both value and type, returning true only when operands match without any coercion, written as a triple equals sign
Reveal the answer + AI explanation — free account

7. What is Loose equality operator?

Junior
  1. A.a per-file declare statement that turns off coercion of scalar arguments so a mismatched type throws a TypeError instead of being silently converted
  2. B.a three-way comparison written as less-than equals greater-than that returns -1, 0, or 1 depending on whether the left side is smaller, equal to, or larger than the right
  3. C.returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices
  4. D.compares two operands for equal value after type coercion, written as a double equals sign
Reveal the answer + AI explanation — free account

8. Which term means: "compares two operands for equal value after type coercion, written as a double equals sign"?

Junior
  1. A.Identical operator
  2. B.Scalar type declaration
  3. C.Loose equality operator
  4. D.Strict types directive
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Junior
  1. A.Loose equality operator — PHP's automatic conversion of a value from one scalar type to another depending on the operator or context in which the value is used
  2. B.Loose equality operator — compares two operands for equal value after type coercion, written as a double equals sign
  3. C.Loose equality operator — compares both value and type, returning true only when operands match without any coercion, written as a triple equals sign
  4. D.Loose equality operator — a per-file declare statement that turns off coercion of scalar arguments so a mismatched type throws a TypeError instead of being silently converted
Reveal the answer + AI explanation — free account

10. What is Null coalescing operator?

Mid
  1. A.the version-8 fix where comparing a number with a non-numeric string now casts the number to string rather than the string to zero, so 0 equals the word foo is finally false
  2. B.returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices
  3. C.compares both value and type, returning true only when operands match without any coercion, written as a triple equals sign
  4. D.PHP's automatic conversion of a value from one scalar type to another depending on the operator or context in which the value is used
Reveal the answer + AI explanation — free account

11. Which term means: "returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices"?

Mid
  1. A.Strict types directive
  2. B.Type juggling
  3. C.Numeric string comparison change in PHP 8
  4. D.Null coalescing operator
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.Null coalescing operator — returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices
  2. B.Null coalescing operator — a three-way comparison written as less-than equals greater-than that returns -1, 0, or 1 depending on whether the left side is smaller, equal to, or larger than the right
  3. C.Null coalescing operator — a hint such as int, float, string, or bool placed on a function parameter or return so the engine validates or coerces the passed value
  4. D.Null coalescing operator — compares two operands for equal value after type coercion, written as a double equals sign
Reveal the answer + AI explanation — free account

13. What is Spaceship operator?

Mid
  1. A.a per-file declare statement that turns off coercion of scalar arguments so a mismatched type throws a TypeError instead of being silently converted
  2. B.a hint such as int, float, string, or bool placed on a function parameter or return so the engine validates or coerces the passed value
  3. C.compares both value and type, returning true only when operands match without any coercion, written as a triple equals sign
  4. D.a three-way comparison written as less-than equals greater-than that returns -1, 0, or 1 depending on whether the left side is smaller, equal to, or larger than the right
Reveal the answer + AI explanation — free account

14. Which term means: "a three-way comparison written as less-than equals greater-than that returns -1, 0, or 1 depending on whether the left side is smaller, equal to, or larger than the right"?

Mid
  1. A.Strict types directive
  2. B.Spaceship operator
  3. C.Identical operator
  4. D.Numeric string comparison change in PHP 8
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.Spaceship operator — compares two operands for equal value after type coercion, written as a double equals sign
  2. B.Spaceship operator — a three-way comparison written as less-than equals greater-than that returns -1, 0, or 1 depending on whether the left side is smaller, equal to, or larger than the right
  3. C.Spaceship operator — returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices
  4. D.Spaceship operator — a per-file declare statement that turns off coercion of scalar arguments so a mismatched type throws a TypeError instead of being silently converted
Reveal the answer + AI explanation — free account

16. What is Scalar type declaration?

Mid
  1. A.returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices
  2. B.the version-8 fix where comparing a number with a non-numeric string now casts the number to string rather than the string to zero, so 0 equals the word foo is finally false
  3. C.PHP's automatic conversion of a value from one scalar type to another depending on the operator or context in which the value is used
  4. D.a hint such as int, float, string, or bool placed on a function parameter or return so the engine validates or coerces the passed value
Reveal the answer + AI explanation — free account

17. Which term means: "a hint such as int, float, string, or bool placed on a function parameter or return so the engine validates or coerces the passed value"?

Mid
  1. A.Null coalescing operator
  2. B.Identical operator
  3. C.Scalar type declaration
  4. D.Numeric string comparison change in PHP 8
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Mid
  1. A.Scalar type declaration — returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices
  2. B.Scalar type declaration — a hint such as int, float, string, or bool placed on a function parameter or return so the engine validates or coerces the passed value
  3. C.Scalar type declaration — compares both value and type, returning true only when operands match without any coercion, written as a triple equals sign
  4. D.Scalar type declaration — the version-8 fix where comparing a number with a non-numeric string now casts the number to string rather than the string to zero, so 0 equals the word foo is finally false
Reveal the answer + AI explanation — free account

19. What is Strict types directive?

Senior
  1. A.a per-file declare statement that turns off coercion of scalar arguments so a mismatched type throws a TypeError instead of being silently converted
  2. B.compares two operands for equal value after type coercion, written as a double equals sign
  3. C.returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices
  4. D.a three-way comparison written as less-than equals greater-than that returns -1, 0, or 1 depending on whether the left side is smaller, equal to, or larger than the right
Reveal the answer + AI explanation — free account

20. Which term means: "a per-file declare statement that turns off coercion of scalar arguments so a mismatched type throws a TypeError instead of being silently converted"?

Senior
  1. A.Loose equality operator
  2. B.Scalar type declaration
  3. C.Identical operator
  4. D.Strict types directive
Reveal the answer + AI explanation — free account

21. Which statement is correct?

Senior
  1. A.Strict types directive — a hint such as int, float, string, or bool placed on a function parameter or return so the engine validates or coerces the passed value
  2. B.Strict types directive — PHP's automatic conversion of a value from one scalar type to another depending on the operator or context in which the value is used
  3. C.Strict types directive — a per-file declare statement that turns off coercion of scalar arguments so a mismatched type throws a TypeError instead of being silently converted
  4. D.Strict types directive — returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices
Reveal the answer + AI explanation — free account

22. What is Numeric string comparison change in PHP 8?

Senior
  1. A.returns its left operand when that operand exists and is not null, otherwise returns the right operand, and suppresses undefined-variable notices
  2. B.the version-8 fix where comparing a number with a non-numeric string now casts the number to string rather than the string to zero, so 0 equals the word foo is finally false
  3. C.a hint such as int, float, string, or bool placed on a function parameter or return so the engine validates or coerces the passed value
  4. D.a per-file declare statement that turns off coercion of scalar arguments so a mismatched type throws a TypeError instead of being silently converted
Reveal the answer + AI explanation — free account

23. Which term means: "the version-8 fix where comparing a number with a non-numeric string now casts the number to string rather than the string to zero, so 0 equals the word foo is finally false"?

Senior
  1. A.Scalar type declaration
  2. B.Numeric string comparison change in PHP 8
  3. C.Type juggling
  4. D.Null coalescing operator
Reveal the answer + AI explanation — free account

24. Which statement is correct?

Senior
  1. A.Numeric string comparison change in PHP 8 — the version-8 fix where comparing a number with a non-numeric string now casts the number to string rather than the string to zero, so 0 equals the word foo is finally false
  2. B.Numeric string comparison change in PHP 8 — compares two operands for equal value after type coercion, written as a double equals sign
  3. C.Numeric string comparison change in PHP 8 — PHP's automatic conversion of a value from one scalar type to another depending on the operator or context in which the value is used
  4. D.Numeric string comparison change in PHP 8 — a hint such as int, float, string, or bool placed on a function parameter or return so the engine validates or coerces the passed value
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Core Language & Types free