CodeIgniter: error insert_batch using PHP7
got this error when executing insert_batch using PHP7 but work without error when using PHP5.6
Severity: Warning Message: array_keys() expects parameter 1 to be array, boolean given Filename: database/DB_query_builder.php Line Number: 1549
it seem that current($key) always returning FALSE on line 1549 (using PHP7)
$keys = array_keys($this->_object_to_array(current($key)));
for a quick fix, i added
reset($key)
before line 1549.
has anyone experiencing this or it’s just me?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (11 by maintainers)
Commits related to this issue
- Fix #4804 — committed to bcit-ci/CodeIgniter by narfbg 7 years ago
- [ci skip] Correct changelog entry for issue #4804 — committed to bcit-ci/CodeIgniter by narfbg 7 years ago
- [ci skip] Correct changelog entry for issue #4804, again — committed to bcit-ci/CodeIgniter by narfbg 7 years ago
@narfbg @iam-adty I tried this, with passing variable in the same way as in
CI_DB_query_builder
. https://3v4l.org/kgkll It seems that internal pointer was reset when passing array to other function with PHP 5.6, but remained with PHP 7.0.This is not a support tickets system, we don’t handle issues based on individuals’ problems. There’s likely a bug here, it’s just unknown what exactly.