The FSM package provides a simple class that implements a Finite State Machine. WWW: https://pear.php.net/package/FSM