facebook/hhvm — pull request #2251 by Aatch (2014-03-31 03:00:42+00:00)
Title: Try to call __toString on objects passed to `file_put_contents`

Before it would just check to see if it was an object, raise a warning and then return false. Now it checks for a `__toString` method first, failing if it doesn't exist.

Fixes #1852