Intermediate PHP
Q63 / 100

What is PHP's type coercion in strict mode?

Correct! Well done.

Incorrect.

The correct answer is B) In strict mode (strict_types=1), passing a wrong type throws TypeError with no coercion

B

Correct Answer

In strict mode (strict_types=1), passing a wrong type throws TypeError with no coercion

Explanation

Without strict_types, PHP coerces "5" to 5 when an int is expected. With strict_types=1, this throws a TypeError.

Progress
63/100