Advanced
PHP
Q100 / 100
What is PHP's static analysis type system compared to TypeScript?
Correct! Well done.
Incorrect.
The correct answer is B) PHP's type system is opt-in with nullable types and union types; tools like PHPStan add generics, conditional types, and template annotations via docblocks
B
Correct Answer
PHP's type system is opt-in with nullable types and union types; tools like PHPStan add generics, conditional types, and template annotations via docblocks
Explanation
PHP's runtime types are enforced by declare(strict_types=1) and type declarations. Generic types (Collection<User>) are only in docblocks, analyzed by Psalm/PHPStan, not enforced at runtime.
Progress
100/100