Getting a Parse Failure when trying to use global aggregation

Hi! I trying to use global aggregation and getting a parse failure
Elasticsearch\Common\Exceptions\BadRequest400Exception
search_parse_exception: Expected [START_OBJECT] under [global], but got a [START_ARRAY] in [price_glob]

my aggs looks like this:

'aggs' => [
    'status_glob' => [
        'global' => [],
        'aggs' => [
            'avg_status' => ['avg' => ['field' => 'status']],
        ]
    ],
]

I am use php with elasticsearch-php-client v2.3.
Can anyone say me where i'm made mistake?

I found solution.
https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/_dealing_with_json_arrays_and_objects_in_php.html

The problem is that PHP will automatically convert "global" : {} into "global" : [], which is no longer valid Elasticsearch DSL and wo solve this problem just write 'global' => new \stdClass()

Thanks for sharing your solution!