Skip to content

Commit

Permalink
Merge pull request #4793 from derrabus/backport/php-8.1
Browse files Browse the repository at this point in the history
Do not pass NULL to internal functions that do not expect NULL
  • Loading branch information
derrabus committed Sep 12, 2021
2 parents 43cbb30 + ac9b251 commit 3ee2622
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Doctrine\DBAL\Types\Type;
use Doctrine\Deprecations\Deprecation;

use function func_num_args;
use function is_string;

/**
Expand Down Expand Up @@ -147,7 +148,11 @@ public function bindParam($param, &$variable, $type = ParameterType::STRING, $le
$this->types[$param] = $type;

try {
return $this->stmt->bindParam($param, $variable, $type, $length);
if (func_num_args() > 3) {
return $this->stmt->bindParam($param, $variable, $type, $length);
}

return $this->stmt->bindParam($param, $variable, $type);
} catch (Exception $e) {
throw $this->conn->convertException($e);
}
Expand Down

0 comments on commit 3ee2622

Please sign in to comment.