Skip to content

Tag: php

Guzzle returns stream empty body instead of json body

When I use Postman to make an API call I receive a JSON object..which is what I expected. However When I make same call with Guzzle like so: I get dump below from Guzzle Answer getBody() returns a stream. If you want to get all the content at once you can use getContents() method and decode json while at it

usort difference php7.1 vs php5.6

I’m currently migrating a project from php5.6 to php7.1. Most is going well, but I just hit a wall on a test. The function usort doesn’t have the same behavior on both version, and it doesn’t seem to be documented (it’s not that two values are equals and then the order is undefined). I…