Skip to content

Commit

Permalink
Merge pull request #4407 from morozov/deprecate-named-param-colon-prefix
Browse files Browse the repository at this point in the history
Deprecate colon prefix for prepared statement parameters
  • Loading branch information
morozov authored Nov 4, 2020
2 parents cad295a + 7b4f16a commit ff83e0b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Upgrade to 2.12

## Deprecated colon prefix for prepared statement parameters

The usage of the colon prefix when binding named parameters is deprecated.

```php
$sql = 'SELECT * FROM users WHERE name = :name OR username = :username';
$stmt = $conn->prepare($sql);

// The usage of the leading colon is deprecated
$stmt->bindValue(':name', $name);

// Only the parameter name should be passed
$stmt->bindValue('username', $username);

$stmt->execute();
```

## PDO signature changes with php 8

In php 8.0, the method signatures of two PDO classes which are extended by DBAL have changed. This affects the following classes:
Expand Down

0 comments on commit ff83e0b

Please sign in to comment.