]> granicus.if.org Git - php/commitdiff
MFH: Fix #46542 Extending PDO class with a __call() function doesn't work
authorJohannes Schlüter <johannes@php.net>
Tue, 17 Feb 2009 14:42:26 +0000 (14:42 +0000)
committerJohannes Schlüter <johannes@php.net>
Tue, 17 Feb 2009 14:42:26 +0000 (14:42 +0000)
as expected

NEWS
ext/pdo/pdo_dbh.c
ext/pdo_sqlite/tests/bug46542.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index b013d5d7905341e07ac23984c8c99871da1f8c22..07caf34074fe99d17c2f95c85785e99b73b99933 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ PHP                                                                        NEWS
 - Fixed bug #47085 (rename() returns true even if the file in PHAR does not exist). (Greg)
 - Fixed bug #47031 (Fix constants in DualIterator example). (Etienne)
 - Fixed bug #46897 (ob_flush() should fail to flush unerasable buffers). (David C.)
+- Fixed bug #46542 (Extending PDO class with a __call() function doesn't work
+  as expected). (Johannes)
 - Fixed bug #46347 (parse_ini_file() doesn't support * in keys). (Nuno)
 - Fixed bug #46048 (SimpleXML top-level @attributes not part of iterator). (David C.)
 - Fixed bug #45432 (PDO: persistent connection leak). (Felipe)
index c3e68ebad8ff7feac164095864c98426de331691..8f443b063684c9df6069b455000034d7613b4ece 100755 (executable)
@@ -1359,7 +1359,7 @@ static union _zend_function *dbh_method_get(
 out:
        if (!fbc) {
                if (std_object_handlers.get_method) {
-                       fbc = std_object_handlers.get_method(object_pp, lc_method_name, method_len TSRMLS_CC);
+                       fbc = std_object_handlers.get_method(object_pp, method_name, method_len TSRMLS_CC);
                }
        }
 
diff --git a/ext/pdo_sqlite/tests/bug46542.phpt b/ext/pdo_sqlite/tests/bug46542.phpt
new file mode 100644 (file)
index 0000000..e08cc14
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+Bug #46542 Extending PDO class with a __call() function
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
+?>
+--FILE--
+<?php
+class A extends PDO
+{ function __call($m, $p) {print __CLASS__."::$m\n";} }
+
+$a = new A('sqlite:dummy.db');
+
+$a->truc();
+$a->TRUC();
+
+?>
+--EXPECT--
+A::truc
+A::truc