File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1347,6 +1347,10 @@ PHP_METHOD(PDOStatement, fetchAll)
1347
1347
ZSTR_VAL (get_active_function_or_method_name ()), ZEND_NUM_ARGS ());
1348
1348
RETURN_THROWS ();
1349
1349
}
1350
+ if (arg2 == NULL ) {
1351
+ zend_argument_type_error (2 , "must be a callable, null given" );
1352
+ RETURN_THROWS ();
1353
+ }
1350
1354
/* TODO Check it is a callable? */
1351
1355
ZVAL_COPY_VALUE (& stmt -> fetch .func .function , arg2 );
1352
1356
if (do_fetch_func_prepare (stmt ) == false) {
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ object(PDOStatement)#%d (1) {
116
116
["queryString"]=>
117
117
string(21) "SELECT * FROM testing"
118
118
}
119
- data: 2,
119
+ data: 2,
120
120
array(2) {
121
121
[0]=>
122
122
string(3) "PHP"
@@ -125,11 +125,8 @@ array(2) {
125
125
}
126
126
function "nothing" not found or invalid function name
127
127
function "" not found or invalid function name
128
+ PDOStatement::fetchAll(): Argument #2 ($arg2) must be a callable, null given
128
129
no array or string given
129
- no array or string given
130
-
131
- Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d
132
- bool(false)
133
130
cannot access "self" when no class scope is active
134
131
array(2) {
135
132
[0]=>
@@ -145,4 +142,4 @@ array(2) {
145
142
}
146
143
non-static method bar::test2() cannot be called statically
147
144
non-static method bar::test3() cannot be called statically
148
- class bar does not have a method "inexistent" in %s on line %d
145
+ class bar does not have a method "inexistent"
You can’t perform that action at this time.
0 commit comments