Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit 428fb2b

Browse files
committed
Update README.md
1 parent 99d9189 commit 428fb2b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@
22

33
Enumerated type for PHP by [Petr Knap].
44

5+
* [What is Enum?](#what-is-enum)
6+
* [Why use Enums instead of Constants?](#why-use-enums-instead-of-constants)
7+
* [Usage of php-enum](#usage-of-php-enum)
8+
* [Enum declaration](#enum-declaration)
9+
* [Enum usage](#enum-usage)
10+
* [How to install](#how-to-install)
511

6-
## What is enum?
12+
13+
## What is Enum?
714

815
> In computer programming, an **enumerated type** (also called **enumeration** or **enum**, or **factor** in the R programming language, and a categorical variable in statistics) is a data type consisting of a set of named values called **elements**, **members**, **enumeral**, or **enumerators** of the type. The enumerator names are usually identifiers that behave as constants in the language. A variable that has been declared as having an enumerated type can be assigned any of the enumerators as a value. In other words, an *enumerated type has values that are different from each other*, and that can be compared and assigned, but which are not specified by the programmer as having any particular concrete representation in the computer's memory; compilers and interpreters can represent them arbitrarily.
916
-- [Enumerated type - Wikipedia, The Free Encyclopedia]
1017

11-
## Why use enum?
18+
## Why use Enums instead of Constants?
1219

13-
Because it is safer than using constants.
20+
Because it is safer and less scary than using constants.
1421

1522
```php
1623
class MyBoolen

0 commit comments

Comments
 (0)