Rob Allen has posted a guide to building and testing PHP 7, the next upcoming major build of the PHP language (released sometime later this year).
The GoPHP7-ext project aims to ensure that all the known PHP extensions out there work with the upcoming PHP 7. This is non-trivial as some significant changes have occurred in the core PHP engine (related to performance) that mean that extensions need to be updated. In order to help out (and prepare my own PHP code for PHP 7!), I needed the latest version of PHP7 working in a vagrant VM. Fortunately Rasmus has created a such a VM called php7dev, so let's start there.
He walks you through the process of grabbing the latest version of the virtual machine and set it up as a Vagrant VM instance. He talks about the different PHP versions contained in the VM and how to update PHP 7 to the latest pre-release version. Finally he talks about building an extension on the VM (he uses the apfd extension) and how to configure the VM to be able to test your own code too.