Skip to content

Commit

Permalink
Update Pdo example
Browse files Browse the repository at this point in the history
  • Loading branch information
saundefined committed Oct 18, 2024
1 parent a55fc09 commit 568f198
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions releases/8.4/release.inc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ PHP
</div>
</div>
<div class="php8-compare">
<h2 class="php8-h2" id="new_array_find">
<h2 class="php8-h2" id="pdo_driver_specific_parsers">
<?= message('pdo_driver_specific_parsers_title', $lang) ?>
<a class="php8-rfc" href="https://wiki.php.net/rfc/pdo_driver_specific_parsers">RFC</a>
</h2>
Expand All @@ -276,12 +276,17 @@ PHP
<?php highlight_php_trimmed(
<<<'PHP'
$connection = new PDO(
'sqlite:host=localhost;dbname=test',
'sqlite:foo.db',
$username,
$password
); // object(PDO)
$connection->query('SELECT * FROM foo');
$connection->sqliteCreateFunction(
'append_php',
static fn($string) => 'PHP ' . $string
);
$connection->query('SELECT append_php(version) FROM php');
PHP
); ?>
</div>
Expand All @@ -293,12 +298,17 @@ PHP
<?php highlight_php_trimmed(
<<<'PHP'
$connection = PDO::connect(
'sqlite:host=localhost;dbname=test',
'sqlite:foo.db',
$username,
$password
); // object(Pdo\Sqlite)
$connection->query('SELECT * FROM foo');
$connection->createFunction(
'append_php',
static fn($string) => 'PHP ' . $string
); // Does not exist on a mismatching driver.
$connection->query('SELECT append_php(version) FROM php');
PHP
); ?>
</div>
Expand Down

0 comments on commit 568f198

Please sign in to comment.