-
Notifications
You must be signed in to change notification settings - Fork 850
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
Support PHP 7.4 #896
Comments
Thanks for the bug report @justin-schroeder, I was able to reproduce it easily. Out of curiosity, how did you discover it? Are you using integers as metadata keys? |
@ob-stripe yep. I suppose we're an odd one out in that sense ha. Sometimes we use numeric keys to "fake" a sortable array of properties. |
Just to be sure there's not another issue at play here, this can only happen if you call |
@ob-stripe actually no, the code was a pretty simple controller method (context is Laravel):
Some of the plans happen to have metadata with numeric keys. |
Just released stripe-php 7.27.3 with your fix, thanks again. Would you mind sharing your account ID and one of the plan IDs so we can take a closer look at what happens on our end? |
Awesome, thanks for the quick fix.
|
We’re running into issues getting the stripe SDK to work in PHP 7.4. The error produced is:
This makes sense, because line 433 is using an array accessor in
StripeObject::toArray()
to determine if a property is public or private before serializing to an array:However, in PHP 7.4 you should not use array notation to access the first character of a number like in PHP 7.3.
For environments that convert error/notices into exceptions (like Laravel) this causes an exception to be thrown.
The text was updated successfully, but these errors were encountered: