symfony/symfony — pull request #5539 by rrehbeindoi (2012-09-18 16:05:00+00:00)
Title: [HttpKernel] Added a bit to convert incomplete objects in the error message

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes*

* no - errors in MongoDbSessionHandlerTest attempting to access private property, however running just src/Symfony/Component/HttpKernel does pass.

Objects of class __PHP_Incomplete_Class are only sometimes an object.

```
$object = unserialize('O:14:"BogusTestClass":0:{}');
$object instanceof __PHP_Incomplete_Class; // true
is_object($object); // false
gettype($object); // "object"
```

Since it is "not an object", the flatter attempts to turn it into a string, it triggers:
```
__PHP_Incomplete_Class could not be converted to string.
```
Which then hides the root error message.