Intermediate PHP
Q61 / 100

What is a PHP enumeration (Enum) added in PHP 8.1?

Correct! Well done.

Incorrect.

The correct answer is B) A special type with a fixed set of named values, optionally backed by string or int

B

Correct Answer

A special type with a fixed set of named values, optionally backed by string or int

Explanation

enum Status { case Active; case Inactive; } Pure enums have no value. Backed enums: enum Status: string { case Active = 'active'; }.

Progress
61/100