mirror of
https://github.com/php/php-src.git
synced 2026-04-03 06:02:23 +02:00
- Fixed bug #50174 (Incorrectly matched docComment)
This commit is contained in:
1
NEWS
1
NEWS
@@ -20,6 +20,7 @@ PHP NEWS
|
||||
- Fixed memory leak in extension loading when an error occurs on Windows.
|
||||
(Pierre)
|
||||
|
||||
- Fixed bug #50174 (Incorrectly matched docComment). (Felipe)
|
||||
- Fixed bug #50087 (NSAPI performance improvements). (Uwe Schindler)
|
||||
- Fixed bug #50152 (ReflectionClass::hasProperty behaves like isset() not
|
||||
property_exists). (Felipe)
|
||||
|
||||
31
Zend/tests/bug50174.phpt
Normal file
31
Zend/tests/bug50174.phpt
Normal file
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Bug #50174 (Incorrectly matched docComment)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class TestClass
|
||||
{
|
||||
/** const comment */
|
||||
const C = 0;
|
||||
|
||||
function x() {}
|
||||
}
|
||||
|
||||
$rm = new ReflectionMethod('TestClass', 'x');
|
||||
var_dump($rm->getDocComment());
|
||||
|
||||
class TestClass2
|
||||
{
|
||||
/** const comment */
|
||||
const C = 0;
|
||||
|
||||
public $x;
|
||||
}
|
||||
|
||||
$rp = new ReflectionProperty('TestClass2', 'x');
|
||||
var_dump($rp->getDocComment());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -3658,6 +3658,12 @@ void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_D
|
||||
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;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user