Change record status: 
Project: 
Introduced in branch: 
10.2.x
Introduced in version: 
10.2.0
Description: 

#3128548: Add optional parameters to StatementInterface::fetchObject() to be in line with the PDO implementation of the method fetchObject() added soft-typing of the method parameters but unfortunately incorrectly set the initial value for the constructor arguments argument. Omitting the second argument and letting it fall back to the default would raise a fatal error.

As a result, the signature has been corrected to reflect the parent class from PHP's PDO and prevent fatal errors when the argument isn't passed.

Any contrib database driver projects that implement StatementInterface::fetchObject will need to adjust their signature accordingly to prevent similar fatal errors.

A backwards compatibility layer is not provided because the current code causes a fatal error.

Before

public function fetchObject(string $class_name = NULL, array $constructor_arguments = NULL) {

After

public function fetchObject(string $class_name = NULL, array $constructor_arguments = []) {

Impacts: 
Module developers