Table of Contents

PHP RFC: Algebraic Data Types

Introduction

This is an over-arching description of a multi-step process to add Algebraic Data Types to PHP. That effort is happening over multiple implementation RFCs in order to keep them individually digestible. Algebraic Data Types are a valuable tool in data modeling, and in “making invalid states unrepresentable,” an effective technique for avoiding many classes of bug.

Proposal

This proposal is implemented in stages. Each stage has its own RFC. Consult the list below for details of each. They are listed in approximately the order in which they can and should be implemented, although in some cases the order may be safely reversed.