Skip to content

Please update paypal SDK to latest version#9

Open
bogdangoia wants to merge 2 commits into
net-shell:masterfrom
bogdangoia:master
Open

Please update paypal SDK to latest version#9
bogdangoia wants to merge 2 commits into
net-shell:masterfrom
bogdangoia:master

Conversation

@bogdangoia

Copy link
Copy Markdown

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