summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDavid Soria Parra <dsp@php.net>2007-12-30 17:51:35 +0000
committerDavid Soria Parra <dsp@php.net>2007-12-30 17:51:35 +0000
commit07487ad0e739e7c7c0db67c9e7a1c7e3e96ed35d (patch)
treef0b0dee3a69a0ab0e9ff4aeb0a21453310d1a2f7 /ext
parentdddc5682db5c874b13df37279444d1141447f9e7 (diff)
downloadphp-git-07487ad0e739e7c7c0db67c9e7a1c7e3e96ed35d.tar.gz
- Fixed bug #43663 (Extending PDO class with a __call() function doesn't work).
CVS
Diffstat (limited to 'ext')
-rwxr-xr-xext/pdo/pdo_dbh.c11
-rw-r--r--ext/pdo/tests/bug_43663.phpt23
2 files changed, 32 insertions, 2 deletions
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 85a53bf93d..251c841fe8 100755
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -1273,12 +1273,19 @@ static union _zend_function *dbh_method_get(
if (zend_hash_find(dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH],
lc_method_name, method_len+1, (void**)&fbc) == FAILURE) {
- fbc = NULL;
+ if (std_object_handlers.get_method) {
+ fbc = std_object_handlers.get_method(object_pp, lc_method_name, method_len TSRMLS_CC);
+ }
+
+ if (!fbc) {
+ fbc = NULL;
+ }
+
goto out;
}
/* got it */
}
-
+
out:
efree(lc_method_name);
return fbc;
diff --git a/ext/pdo/tests/bug_43663.phpt b/ext/pdo/tests/bug_43663.phpt
new file mode 100644
index 0000000000..25af588bbe
--- /dev/null
+++ b/ext/pdo/tests/bug_43663.phpt
@@ -0,0 +1,23 @@
+--TEST--
+PDO Common: Bug #43663 (__call on classes derived from PDO)
+--FILE--
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+?>
+--FILE--
+<?php
+class test extends PDO{
+ function __call($name, array $args) {
+ echo "Called $name in ".__CLASS__."\n";
+ }
+ function foo() {
+ echo "Called foo in ".__CLASS__."\n";
+ }
+}
+$a = new test('sqlite::memory:');
+$a->foo();
+$a->bar();
+--EXPECT--
+Called foo in test
+Called bar in test