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

Fixed bug #24871 (methods misidentified as constructors)

This commit is contained in:
Ilia Alshanetsky
2003-08-01 02:17:31 +00:00
parent 6f53bb90e4
commit 498c4ce19d
3 changed files with 20 additions and 1 deletions

1
NEWS
View File

@@ -4,6 +4,7 @@ PHP 4 NEWS
- Fixed bug #22154 (Possible crash when memory_limit is reached and
output buffering in addition to session.use_trans_sid is used). (Ilia)
- Fixed bug #24883 (variables_order and gpc_order being ignored). (Ilia)
- Fixed bug #24871 (methods misidentified as constructors). (Ilia)
30 Jul 2003, Version 4.3.3RC2
- Improved the NSAPI SAPI module (Uwe Schindler)

View File

@@ -114,7 +114,7 @@ static void aggregate_methods(zend_class_entry *ce, zend_class_entry *from_ce, i
/* We do not aggregate:
* 1. constructors */
if (!strncmp(func_name, from_ce->name, MIN(func_name_len-1, from_ce->name_length)) ||
if (!strncmp(func_name, from_ce->name, MAX(func_name_len-1, from_ce->name_length)) ||
/* 2. private methods (heh, like we really have them) */
func_name[0] == '_' ||
/* 3. explicitly excluded methods */

View File

@@ -0,0 +1,18 @@
--TEST--
Bug #24871 (methods misidentified as constructors)
--FILE--
<?php
class a { }
class b {
function bb() {
var_dump(method_exists($this, "bb"));
}
}
$a = new a();
aggregate($a, "b");
$a->bb();
?>
--EXPECT--
bool(true)