Core Language & Types interview questions

24 Core Language & Types questions from the PHP bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Core Language & Types question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers