xref: /PHP-8.2/Zend/tests/bug70914.phpt (revision 74859783)
1--TEST--
2Bug #70914 zend_throw_or_error() format string vulnerability
3--EXTENSIONS--
4pdo_sqlite
5--FILE--
6<?php
7
8$db = new PDO('sqlite::memory:');
9$st = $db->query('SELECT 1');
10try {
11    $re = $st->fetchObject('%Z');
12} catch (TypeError $e) {
13    echo $e->getMessage(), "\n";
14}
15?>
16--EXPECT--
17PDOStatement::fetchObject(): Argument #1 ($class) must be a valid class name, %Z given
18