1
votes

Does somebody know why accessing an object's property using array syntax works in some php versions but not others?

In the following line of code from the Amazon PHP SDK they do this and seems not to work in my dev server but works fine in my local server and production server

https://github.com/aws/aws-sdk-php/blob/master/src/Aws/Common/Client/UploadBodyListener.php#L75

PHP PHP 5.3.10-1ubuntu3.13 with Suhosin-Patch (cli)

Error:

Fatal error: Cannot use object of type Guzzle\Common\Event as array in /mnt/var/www/dev3.pearup.com/common/vendor/aws/aws-sdk-php/src/Aws/Common/Client/UploadBodyListener.php on line 75

1

1 Answers

0
votes

You can do this by implementing an ArrayObject.

So the object you send to that function should also be an ArrayObject.