We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df39586 commit bd8c770Copy full SHA for bd8c770
ext/sqlite3/sqlite3.c
@@ -701,9 +701,10 @@ PHP_METHOD(SQLite3, querySingle)
701
if (!entire_row) {
702
sqlite_value_to_zval(stmt, 0, return_value);
703
} else {
704
- int i = 0;
705
- array_init(return_value);
706
- for (i = 0; i < sqlite3_data_count(stmt); i++) {
+ int i = 0, count = sqlite3_data_count(stmt);
+
+ array_init_size(return_value, count);
707
+ for (i = 0; i < count; i++) {
708
zval data;
709
sqlite_value_to_zval(stmt, i, &data);
710
add_assoc_zval(return_value, (char*)sqlite3_column_name(stmt, i), &data);
0 commit comments