Warning: sizeof() / setPlaceholders
Closed this issue ยท 3 comments
sommcz commented
Hi,
i want to use slilm/pdo lib on newer PHP version (in my case 7.2), and it throws and warning due to use of sizeof function with plain variable (not array) in StatementContainer::setPlaceholders.
Solution could be quite simple, as sizeof is needed only for array type in there.
Can you fix it in library? Or if you prefer, i could suggest fix or other help.
It works ok at version 7.0, is looks like sizeof doesn't throw a warning.
Thank you
nixoncode commented
$this->placeholders[] = $this->setPlaceholder('?', is_null($value) ? 1 : (is_Array($value) ? sizeof($value) : 1));
FaaPz commented
Thanks @nixoncode! I've implemented your small fix in v1.11.0 (a84ac97). Couldn't use your PR, because of a branch name change I pushed to early. ๐
nixoncode commented
That's awesome
โฆOn Wed, Mar 6, 2019, 4:21 PM Fabian de Laender ***@***.***> wrote:
Thanks @nixoncode <https://github.com/nixoncode>! I've implemented your
small fix in *v1.11.0* (a84ac97
<a84ac97>).
Couldn't use your PR, because of a branch name change I pushed to early.
๐
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#92 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AO_26JJfL0RBtiH3zbRrZPMaJBSilqbkks5vT8DAgaJpZM4RNZG_>
.