Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MFH: Fix #46542 Extending PDO class with a __call() function doesn't …

…work

as expected
  • Loading branch information...
commit 162aed0aedad595331424bce4e5fc12dfaa53897 1 parent a7eb83f
Johannes Schlüter johannes authored
Showing with 23 additions and 1 deletion.
  1. +2 −0  NEWS
  2. +1 −1  ext/pdo/pdo_dbh.c
  3. +20 −0 ext/pdo_sqlite/tests/bug46542.phpt
2  NEWS
View
@@ -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)
2  ext/pdo/pdo_dbh.c
View
@@ -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);
}
}
20 ext/pdo_sqlite/tests/bug46542.phpt
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.