felipe Wed, 15 Jul 2009 01:11:24 +0000 URL: http://svn.php.net/viewvc?view=revision&revision=284092
Changed paths: U php/php-src/branches/PHP_5_3/NEWS A php/php-src/branches/PHP_5_3/Zend/tests/bug48899.phpt U php/php-src/branches/PHP_5_3/Zend/zend_API.c Log: - MFH: Fixed bug #48899 (is_callable returns true even if method does not exist in parent class) Modified: php/php-src/branches/PHP_5_3/NEWS =================================================================== --- php/php-src/branches/PHP_5_3/NEWS 2009-07-15 01:08:15 UTC (rev 284091) +++ php/php-src/branches/PHP_5_3/NEWS 2009-07-15 01:11:24 UTC (rev 284092) @@ -6,6 +6,8 @@ - Fixed open_basedir circumvention for mail.log. (Maksymilian Arciemowicz, Stas) +- Fixed bug #48899 (is_callable returns true even if method does not exist in + parent class). (Felipe) - Fixed bug #48854 (array_merge_recursive modifies arrays after first one). (Felipe) - Fixed bug #48788 (RecursiveDirectoryIterator doesn't descend into symlinked Added: php/php-src/branches/PHP_5_3/Zend/tests/bug48899.phpt =================================================================== --- php/php-src/branches/PHP_5_3/Zend/tests/bug48899.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/Zend/tests/bug48899.phpt 2009-07-15 01:11:24 UTC (rev 284092) @@ -0,0 +1,24 @@ +--TEST-- +Bug #48899 (is_callable returns true even if method does not exist in parent class) +--FILE-- +<?php + +class ParentClass { } + +class ChildClass extends ParentClass { + public function testIsCallable() { + var_dump(is_callable(array($this, 'parent::testIsCallable'))); + } + public function testIsCallable2() { + var_dump(is_callable(array($this, 'static::testIsCallable2'))); + } +} + +$child = new ChildClass(); +$child->testIsCallable(); +$child->testIsCallable2(); + +?> +--EXPECT-- +bool(false) +bool(true) Property changes on: php/php-src/branches/PHP_5_3/Zend/tests/bug48899.phpt ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c =================================================================== --- php/php-src/branches/PHP_5_3/Zend/zend_API.c 2009-07-15 01:08:15 UTC (rev 284091) +++ php/php-src/branches/PHP_5_3/Zend/zend_API.c 2009-07-15 01:11:24 UTC (rev 284092) @@ -2519,7 +2519,7 @@ } } else { get_function_via_handler: - if (fcc->object_ptr) { + if (fcc->object_ptr && fcc->calling_scope == ce_org) { if (Z_OBJ_HT_P(fcc->object_ptr)->get_method) { fcc->function_handler = Z_OBJ_HT_P(fcc->object_ptr)->get_method(&fcc->object_ptr, mname, mlen TSRMLS_CC); if (fcc->function_handler) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php