Skip to content

Commit 537f322

Browse files
committed
Update Pdo example
1 parent 8dc9f46 commit 537f322

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

releases/8.4/release.inc

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ PHP
265265
</div>
266266
</div>
267267
<div class="php8-compare">
268-
<h2 class="php8-h2" id="new_array_find">
268+
<h2 class="php8-h2" id="pdo_driver_specific_parsers">
269269
<?= message('pdo_driver_specific_parsers_title', $lang) ?>
270270
<a class="php8-rfc" href="https://wiki.php.net/rfc/pdo_driver_specific_parsers">RFC</a>
271271
</h2>
@@ -276,12 +276,17 @@ PHP
276276
<?php highlight_php_trimmed(
277277
<<<'PHP'
278278
$connection = new PDO(
279-
'sqlite:host=localhost;dbname=test',
279+
'sqlite:foo.db',
280280
$username,
281281
$password
282282
); // object(PDO)
283283
284-
$connection->query('SELECT * FROM foo');
284+
$connection->sqliteCreateFunction(
285+
'append_php',
286+
static fn($string) => 'PHP ' . $string
287+
);
288+
289+
$connection->query('SELECT append_php(version) FROM php');
285290
PHP
286291
); ?>
287292
</div>
@@ -293,12 +298,17 @@ PHP
293298
<?php highlight_php_trimmed(
294299
<<<'PHP'
295300
$connection = PDO::connect(
296-
'sqlite:host=localhost;dbname=test',
301+
'sqlite:foo.db',
297302
$username,
298303
$password
299304
); // object(Pdo\Sqlite)
300305
301-
$connection->query('SELECT * FROM foo');
306+
$connection->createFunction(
307+
'append_php',
308+
static fn($string) => 'PHP ' . $string
309+
); // Does not exist on a mismatching driver.
310+
311+
$connection->query('SELECT append_php(version) FROM php');
302312
PHP
303313
); ?>
304314
</div>

0 commit comments

Comments
 (0)