Skip to content
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

Please update paypal SDK to latest version #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Please update paypal SDK to latest version #9

wants to merge 2 commits into from

Conversation

bogdangoia
Copy link

I get this error: geting error sizeof(): Parameter must be an array or an object that implements Countable

The error is in the paypal\rest-api-sdk-php package you are using. The version of the package you are using is, apparently, not exactly compatible with PHP 7.2.

The specific error you are getting has been fixed in the latest version of the package (1.13.0). Update the package to the latest version, and this issue will be fixed. I cannot say what other issues may pop up, though.

In the 1.12.0 version, the specific line that is failing is:

} elseif (sizeof($v) <= 0 && is_array($v)) {

In PHP 7.2, if $v is not Countable, the sizeof() call will emit a warning, and Laravel will turn that warning into an exception.

In the 1.13.0 version, they updated the condition to be

} elseif (is_array($v) && sizeof($v) <= 0) {

Now, sizeof() will only be called when $v is an array, and therefore is guaranteed to be Countable, thus eliminating the warning.

https://stackoverflow.com/a/49506993

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant