|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78126 PDO::sqliteCreateFunction is not exposed via reflection
Submitted: 2019-06-07 23:32 UTC Modified: 2021-09-13 14:44 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: morozov at tut dot by Assigned:
Status: Open Package: PDO SQLite
PHP Version: 7.3.6 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-06-07 23:32 UTC] morozov at tut dot by
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:
Method PDO::sqliteCreateFunction() does not exist


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-08 00:46 UTC] morozov at tut dot by
The same is true for other PDO::sqlite*() and PDO::pgsql*() functions.
 [2019-06-16 03:27 UTC] camporter1 at gmail dot com
The issue here as far as I can tell is that driver methods are not defined directly on the PDO class entry. Instead, an object handler is used to get these methods. From what I can tell, reflection seems to rely only on the class entry.

Since I was curious, I opened as an experimental solution.

This still wouldn't solve listing all of the available methods under get_method, and it's clunky.
 [2019-06-16 03:28 UTC] camporter1 at gmail dot com
The following pull request has been associated:

Patch Name: Change ReflectionMethod object construction to support get_method-based methods
On GitHub:
 [2021-09-13 14:44 UTC]
In my opinion, we should not add support for this to reflection,
but rather get rid of the magic methods, one way or another.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 05 10:01:31 2024 UTC