Bug #78126 [Opn]: PDO::sqliteCreateFunction is not exposed via reflection

From: Date: Mon, 13 Sep 2021 14:44:21 +0000
Subject: Bug #78126 [Opn]: PDO::sqliteCreateFunction is not exposed via reflection
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236569@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78126&edit=1 ID: 78126 Updated by: cmb@php.net Reported by: morozov at tut dot by Summary: PDO::sqliteCreateFunction is not exposed via reflection Status: Open Type: Bug Package: PDO SQLite Operating System: Linux PHP Version: 7.3.6 Block user comment: N Private report: N New Comment: In my opinion, we should not add support for this to reflection, but rather get rid of the magic methods, one way or another. Previous Comments: ------------------------------------------------------------------------ [2019-06-16 03:28:54] 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 ------------------------------------------------------------------------ [2019-06-16 03:27:41] 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-08 00:46:18] morozov at tut dot by The same is true for other PDO::sqlite*() and PDO::pgsql*() functions. ------------------------------------------------------------------------ [2019-06-07 23:32:23] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78126&edit=1

« previous php.bugs (#236569) next »