Skip to content

Commit 6c6826e

Browse files
committed
ext/pdo: Fix failing test
1 parent efae145 commit 6c6826e

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

ext/pdo/pdo_stmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ PHP_METHOD(PDOStatement, fetchObject)
10611061

10621062
old_ce = stmt->fetch.cls.ce;
10631063
old_ctor_args = stmt->fetch.cls.ctor_args;
1064-
stmt->fetch.cls.ctor_args = NULL;
1064+
10651065
if (ce == NULL) {
10661066
ce = zend_standard_class_def;
10671067
}

ext/pdo/tests/pdo_stmt_fetchobject_ctor_args_after_default.phpt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,16 @@ $db = PDOTest::factory();
5353
PDOTest::dropTableIfExists($db, "pdo_stmt_fetchobject_ctor_args_after_default");
5454
?>
5555
--EXPECTF--
56-
object(Foo)#3 (2) {
56+
object(Foo)#%d (2) {
5757
["id"]=>
5858
int(1)
5959
["v"]=>
6060
string(5) "Hello"
6161
}
6262
ValueError: PDOStatement::fetchObject(): Argument #2 ($constructorArgs) must be empty when class provided in argument #1 ($class) does not have a constructor
63-
64-
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Foo::__construct(), 0 passed and exactly 1 expected in %s:%d
65-
Stack trace:
66-
#0 [internal function]: Foo->__construct()
67-
#1 %s(%d): PDOStatement->fetch()
68-
#2 {main}
69-
thrown in %s on line %d
63+
object(Foo)#%d (2) {
64+
["id"]=>
65+
int(2)
66+
["v"]=>
67+
string(5) "Hello"
68+
}

0 commit comments

Comments
 (0)