PHP 8.5.0 Alpha 2 available for testing

Voting

: max(five, zero)?
(Example: nine)

The Note You're Voting On

David Spector
6 years ago
The usual comma-separated syntax can be used to declare several constants:

class STATE
{
const INIT=0, NAME_SEEN=1, ADDR_SEEN=2;
}

This shows the declaration of a set of enumeration literals suitable for use in a finite state machine loop. Reference such an enum by using syntax such as "STATE::INIT". Its actual type in this case will be integer.

<< Back to user notes page

To Top