php.net |  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: 2019-06-08 00:46 UTC
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: morozov at tut dot by
New email:
PHP Version: OS:

 

 [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


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

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 https://github.com/php/php-src/pull/4271 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:  https://github.com/php/php-src/pull/4271
Patch:      https://github.com/php/php-src/pull/4271.patch
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Sep 19 10:01:26 2019 UTC