Closed snelg closed 8 years ago
Released on v1.0.1. Thanks a lot!
Unimportant anecdote: I've been using your package for over a year, and in the back of my mind I kind of wondered where the name "yajra" came from. When I was submitting this pull request, I finally figured it out. And then I felt extra dumb for not figuring it out earlier because, well, look at my username :)
-Glen S.
bindValue breaks in PHP 7, but the fix is simple. Here's a minimal code sample that works in PHP 5, but not 7:
In 7, it blows up with a "ORA-01722: invalid number", because by the time the oci_execute function is called, the bound $variable has disappeared. It seems that PHP 7 is smarter about disposing of variables it deems no longer necessary. So the copy of $variable that's created when bindValue is called disappears once bindValue exits.
My proposed fix in this patch is to simply add the $variable to $this->bindings by reference. That way, PHP will know that the variable itself needs to persist after bindValue exits.