From: Felipe Pena Date: Sat, 14 Nov 2009 19:17:22 +0000 (+0000) Subject: - Fixed bug #50174 (Incorrectly matched docComment) X-Git-Tag: php-5.2.12RC2~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df042dc98e9eaa8469e660793637fe0ed27ea21f;p=php - Fixed bug #50174 (Incorrectly matched docComment) --- diff --git a/NEWS b/NEWS index 5b17e77edb..103417a17d 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Nov 2009, PHP 5.2.12RC2 +- Fixed bug #50174 (Incorrectly matched docComment). (Felipe) 12 Nov 2009, PHP 5.2.12RC1 - Updated timezone database to version 2009.18 (2009r). (Derick) diff --git a/Zend/tests/bug50174.phpt b/Zend/tests/bug50174.phpt new file mode 100644 index 0000000000..6ed5733b67 --- /dev/null +++ b/Zend/tests/bug50174.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #50174 (Incorrectly matched docComment) +--FILE-- +getDocComment()); + +class TestClass2 +{ + /** const comment */ + const C = 0; + + public $x; +} + +$rp = new ReflectionProperty('TestClass2', 'x'); +var_dump($rp->getDocComment()); + +?> +--EXPECT-- +bool(false) +bool(false) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 1e3e205dab..3c34743619 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3103,6 +3103,12 @@ void zend_do_declare_class_constant(znode *var_name, znode *value TSRMLS_DC) zend_error(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s", CG(active_class_entry)->name, var_name->u.constant.value.str.val); } FREE_PNODE(var_name); + + if (CG(doc_comment)) { + efree(CG(doc_comment)); + CG(doc_comment) = NULL; + CG(doc_comment_len) = 0; + } }