How PHP’s SplObjectStorage Solves Problems You Didn’t Know You Had

Five patterns SplObjectStorage solves better than arrays: observers, cycles, sets, metadata, and identity-based tracking. With code.