laravel/framework — pull request #2312 by arthurdarcet (2013-09-18 13:21:16+00:00)
Title: When the content returned by a controller extends ArrayObject, serialize it as Json

`json_encode` always encode an empty array as `[]`. So currently the only way to have a controller return a json response `{}` is to create a custom object implementing `JsonableInterface`.

The `ArrayObject` solve perfectly that problem since PHP 5.0, as long as the Laravel `Response` serialize them as JSON.

So this pull request add `ArrayObject` to the list of controller responses that get cast as JSON automatically (along with `JsonableInterface` and raw arrays)