mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
- Fixed bug #52051 (handling of case sensitivity of old-style constructors changed in 5.3+)
This commit is contained in:
parent
becc2bb671
commit
2c2fcc2217
27
Zend/tests/bug52051.phpt
Normal file
27
Zend/tests/bug52051.phpt
Normal file
@ -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
|
@ -1096,7 +1096,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
|
||||
/* 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);
|
||||
|
Loading…
Reference in New Issue
Block a user