Add tests for https://github.com/facebook/hhvm/issues/1357
Merge branch 'master' into hhvm