felipe Sat, 12 Jun 2010 15:30:21 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=300407
Log: - Fixed bug #52051 (handling of case sensitivity of old-style constructors changed in 5.3+) Bug: http://bugs.php.net/52051 (Assigned) handling of case sensitivity of old-style constructors changed in 5.3+ Changed paths: U php/php-src/branches/PHP_5_3/NEWS A php/php-src/branches/PHP_5_3/Zend/tests/bug52051.phpt U php/php-src/branches/PHP_5_3/Zend/zend_object_handlers.c A php/php-src/trunk/Zend/tests/bug52051.phpt U php/php-src/trunk/Zend/zend_object_handlers.c Modified: php/php-src/branches/PHP_5_3/NEWS =================================================================== --- php/php-src/branches/PHP_5_3/NEWS 2010-06-12 15:21:17 UTC (rev 300406) +++ php/php-src/branches/PHP_5_3/NEWS 2010-06-12 15:30:21 UTC (rev 300407) @@ -74,6 +74,8 @@ - Fixed bug #52060 (Memory leak when passing a closure to method_exists()). (Felipe) - Fixed bug #52057 (ReflectionClass fails on Closure class). (Felipe) +- Fixed bug #52051 (handling of case sensitivity of old-style constructors + changed in 5.3+). (Felipe) - Fixed bug #52019 (make lcov doesn't support TESTS variable anymore). (Patrick) - Fixed bug #52010 (open_basedir restrictions mismatch on vacuum command). (Ilia) Added: php/php-src/branches/PHP_5_3/Zend/tests/bug52051.phpt =================================================================== --- php/php-src/branches/PHP_5_3/Zend/tests/bug52051.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/Zend/tests/bug52051.phpt 2010-06-12 15:30:21 UTC (rev 300407) @@ -0,0 +1,27 @@ +--TEST-- +Bug #52051 (handling of case sensitivity of old-style constructors changed in 5.3+) +--FILE-- +<?php + +class AA { + function AA() { echo "foo\n"; } +} +class bb extends AA {} +class CC extends bb { + function CC() { parent::bb(); } +} +new CC(); + +class A { + function A() { echo "bar\n"; } +} +class B extends A {} +class C extends B { + function C() { parent::B(); } +} +new C(); + +?> +--EXPECT-- +foo +bar Property changes on: php/php-src/branches/PHP_5_3/Zend/tests/bug52051.phpt ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native Modified: php/php-src/branches/PHP_5_3/Zend/zend_object_handlers.c =================================================================== --- php/php-src/branches/PHP_5_3/Zend/zend_object_handlers.c 2010-06-12 15:21:17 UTC (rev 300406) +++ php/php-src/branches/PHP_5_3/Zend/zend_object_handlers.c 2010-06-12 15:30:21 UTC (rev 300407) @@ -945,7 +945,7 @@ /* Only change the method to the constructor if the constructor isn't called __construct * we check for __ so we can be binary safe for lowering, we should use ZEND_CONSTRUCTOR_FUNC_NAME */ - if (!memcmp(lc_class_name, function_name_strval, function_name_strlen) && memcmp(ce->constructor->common.function_name, "__", sizeof("__") - 1)) { + if (!memcmp(lc_class_name, lc_function_name, function_name_strlen) && memcmp(ce->constructor->common.function_name, "__", sizeof("__") - 1)) { fbc = ce->constructor; } efree(lc_class_name); Added: php/php-src/trunk/Zend/tests/bug52051.phpt =================================================================== --- php/php-src/trunk/Zend/tests/bug52051.phpt (rev 0) +++ php/php-src/trunk/Zend/tests/bug52051.phpt 2010-06-12 15:30:21 UTC (rev 300407) @@ -0,0 +1,27 @@ +--TEST-- +Bug #52051 (handling of case sensitivity of old-style constructors changed in 5.3+) +--FILE-- +<?php + +class AA { + function AA() { echo "foo\n"; } +} +class bb extends AA {} +class CC extends bb { + function CC() { parent::bb(); } +} +new CC(); + +class A { + function A() { echo "bar\n"; } +} +class B extends A {} +class C extends B { + function C() { parent::B(); } +} +new C(); + +?> +--EXPECT-- +foo +bar Property changes on: php/php-src/trunk/Zend/tests/bug52051.phpt ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native Modified: php/php-src/trunk/Zend/zend_object_handlers.c =================================================================== --- php/php-src/trunk/Zend/zend_object_handlers.c 2010-06-12 15:21:17 UTC (rev 300406) +++ php/php-src/trunk/Zend/zend_object_handlers.c 2010-06-12 15:30:21 UTC (rev 300407) @@ -1096,7 +1096,7 @@ /* Only change the method to the constructor if the constructor isn't called __construct * we check for __ so we can be binary safe for lowering, we should use ZEND_CONSTRUCTOR_FUNC_NAME */ - if (!memcmp(lc_class_name, function_name_strval, function_name_strlen) && memcmp(ce->constructor->common.function_name, "__", sizeof("__") - 1)) { + if (!memcmp(lc_class_name, lc_function_name, function_name_strlen) && memcmp(ce->constructor->common.function_name, "__", sizeof("__") - 1)) { fbc = ce->constructor; } efree(lc_class_name);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php