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

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

index f2e211b20ecceca947932dd77ff8f0e5a0d70bfc..ceab49a36001641630ce934bf605bcc472a9464d 100755 (executable)
@@ -1366,7 +1366,7 @@ static union _zend_function *dbh_method_get(
 
 out:
        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);
        }
 
        pdo_zstr_efree(lc_method_name);
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