Add tests for PHP-447
Merge pull request #408