First PHP assignment

Getting this started to fix #588.

Run tests like this:

```
% php phpunit.phar trinary/trinary_test.php
```