|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-06-07 23:32 UTC] morozov at tut dot by
Description:
------------
Despite being available at runtime, PDO::sqliteCreateFunction is not exposed via reflection: neither via the Reflection API, nor via the command line (php --rc).
Test script:
---------------
$conn = new PDO('sqlite::memory:');
var_dump(method_exists($conn, 'sqliteCreateFunction'));
try {
$re = new ReflectionMethod($conn, 'sqliteCreateFunction');
} catch (ReflectionException $e) {
echo $e->getMessage(), PHP_EOL;
}
Expected result:
----------------
Method reflection is created
Actual result:
--------------
bool(true)
Method PDO::sqliteCreateFunction() does not exist
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 01:00:02 2025 UTC |
This is basically resolved by the introduction of driver specific PDO subclasses[1]. Slightly modified test script: <?php $conn = new Pdo\Sqlite('sqlite::memory:'); var_dump(method_exists($conn, 'createFunction')); try { $re = new ReflectionMethod($conn, 'createFunction'); } catch (ReflectionException $e) { echo $e->getMessage(), PHP_EOL; } ?> outputs bool(true) I think this is as good as it gets. [1] <https://wiki.php.net/rfc/pdo_driver_specific_subclasses>