New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupported operand types #2016
Comments
What is your Guzzle version? What is your PHP version? A bit more detailed stack trace would be nice, because without that you won't be able to find the usage of the library and without input parameters we cannot reproduce the issue. Looking at the latest code on the aformentioned line there is an array merging operation which awaits two arrays. Maybe there is an uncompatible input there. |
I'm sorry, it's actually the first time i'm asking help here for something. About the logs, it's all i got. |
No problem, just a friendly reminder. ;)
You can check the version in the composer.lock file |
I'll keep that in my mind for the future, thanks :) I'm using guzzlehttp 6.3.0 |
Without the actual stack trace it's going to be hard to identify the problem. Can you debug the code? If you have no debugging tools at hand, at least could you go to that line and var_dump the two operands (poor mans debug)? |
I've only the code of the guzzle library on my folder. The only line of code i've called is It concern the operand "$result = $options + $defaults;" Here's the complete function affiliated :
|
Yup, that's it. This line in particular:
Can you dump those two variables before merging them? |
Here's what i got.
(Sorry for the late answer) |
Well, you will have to debug how that value reached the prepare method. It's provided by some external caller. |
Hello @P147x, did you solved that problem? |
1 similar comment
Hello @P147x, did you solved that problem? |
Hello guys, sorry for the last answer. |
my $options value and $defaults value: |
this is my trace: |
also having issue with
|
This is perfectly fine and well documented at https://www.php.net/manual/en/language.operators.array.php
Or in plain english: it's the most common way to have a user-provided array and a defaults-array and produce a result where all the defaults missing in the user-provided are filled in. The method is poignantly called Everyone having the problem: the problem is that something outside Guzzle passes data in where either operand is not an array anymore, as is evident by #2016 (comment) |
Thank you @mfn |
It happens when you don't call the Guzzle client construct method. |
This is my stack trace for a similar issue with
and part of the code
Noticed that when running this locally I end up in the This piece of code runs as part of a job and the server also has New Relic extension installed on it...not sure if this is the problem but found this (https://discuss.newrelic.com/t/php-guzzle-errors-in-php-agent-9-0/91477/22) I'm trying to figure out how this happens and will update this post if I can find out why. |
As to the reference with the newrelic forum, be careful, the last comment says:
Which is a clear indicator it's unrelated to Guzzle.
This is exactly this line: $result = $options + $defaults; Either I suggest to temporarily add debugging code before this line to witness what those two values are and check it out once you hit problem again. |
Running locally, my debugger stops in the Still digging, but what could cause |
Oh, thanks for pointing this out again! You already mentioned it but I missed it. This is very strange.
What perplexes me, it looks like there something missing: how could it get there?
Ah, that Line 42 in de6f1e5
Is there a problem with code being not up2date, weird caching? Looks like as if the |
This error started occuring after upgrading a project from Laravel 5.x to 8 (Guzzle The composer log on deploy shows this
Checked the vendor directory on the server and can see that this trait exists and looks correct in the sense that the |
I'm also having this issue on Laravel 8, Guzzle 7.3. I use New Relic, so I think it's probably related to that. |
I'm seeing this after installing New Relic, never before. I suppose its new relic related |
anyone solve it? |
Upgrade to the latest version. You may need ton upgrade both local and global. |
Hello,
I'm actually trying to use Auth0 integration on a Prestashop module, but after installed the integration with Composer, i've this error :
[PrestaShop] Fatal error in module file: /var/www/html/modules/prestashop/vendor/guzzlehttp/guzzle/src/Client.php:236
Unsupported operand types
Is that a bug ? It's actually stucking me.
Thanks in advance.
Lucas
The text was updated successfully, but these errors were encountered: