Intermediate PHP
Q51 / 100

What are PHP attributes (PHP 8)?

Correct! Well done.

Incorrect.

The correct answer is B) Structured metadata annotations on classes, functions, and parameters using #[Attribute]

B

Correct Answer

Structured metadata annotations on classes, functions, and parameters using #[Attribute]

Explanation

#[Route("/home")] is an attribute. Unlike docblock annotations, attributes are native PHP syntax readable via Reflection, enabling frameworks to use them natively.

Progress
51/100