go to bug id or search bugs for
Simple insert on oracle database using Doctrine with OCI8 driver on PHP 7.
All the columns get overwritten by value of the last call to OCI8Statement->bindValue.
Table creation script can be found at db/ of the test script repository
The code on public/only_oci8.php reproduces the problem without Doctrine.
Add a Patch
Add a Pull Request
duplicate of https://bugs.php.net/bug.php?id=70302
Looks like an expected change with PHP 7.
OCI8 needs the zval of the bound variable to be available when OCIExecute is called.
Try using pass by reference in your bindValue() function, or don't bind in a function.
This is similar to example #3 in http://php.net/manual/en/function.oci-bind-by-name.php
From the dev who analyzed this:
"Reason for this new behavior in PHP 7 is that, unlike in PHP 5.6, zval (_zend_value) in PHP 7.0 is no more have reference count field. Only its values field (zend_value) has reference count field.
Since we store the placeholder (i.e., zval variable) [not its content (zend_value)] in php_oci_bind structure, it gets overwritten when oci_bind_by_name() is called with same variable and different content in it."
Related To: Bug #71947
The following patch has been added/updated:
Patch Name: oci8-php7-bind
Frank has a suggested patch; try it and let us know whether it works for you.
Related To: Bug #73206
Related To: Bug #73080
Related To: Bug #73085
Automatic comment on behalf of firstname.lastname@example.org
Log: Fixed bug #71148 (Bind reference overwritten on PHP 7)