1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00

MFH Fix #44425 (Extending PDO/MySQL class with a __call() function doesn't work)

This commit is contained in:
Johannes Schlüter
2008-09-16 23:35:50 +00:00
parent 4c32eb9989
commit 2c98da2d17
2 changed files with 7 additions and 6 deletions

View File

@@ -1293,9 +1293,6 @@ 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) {
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;
@@ -1307,6 +1304,12 @@ 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);
}
}
efree(lc_method_name);
return fbc;
}

View File

@@ -36,7 +36,7 @@ if (version_compare(PHP_VERSION, '5.0.0', '<'))
}
public function __call($method, $args) {
print "__call()";
print "__call(".var_export($method,true).", ".var_export($args, true).")\n";
// $this->protocol();
}
@@ -74,8 +74,6 @@ if (version_compare(PHP_VERSION, '5.0.0', '<'))
$db->exec('DROP TABLE IF EXISTS test');
print "done!\n";
?>
--XFAIL--
PDO doesn't like __call()
--EXPECTF--
__construct('%s', '%s', '%s')
exec('DROP TABLE IF EXISTS test')