mirror of
https://github.com/php/php-src.git
synced 2025-08-17 22:48:57 +02:00

Squashed commit of the following: commitf11ca0e7a5
Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Dec 8 12:38:42 2015 +0300 Fixed test expectation commit211f873f54
Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Dec 8 12:28:38 2015 +0300 Embed zend_class_constant.flags into zend_class_constants.value.u2.access_flags commit51deab84b2
Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Dec 7 11:18:55 2015 +0300 Fixed issues found by Nikita commit544dbd5b47
Author: Dmitry Stogov <dmitry@zend.com> Date: Sat Dec 5 02:41:05 2015 +0300 Refactored immplementation of https://wiki.php.net/rfc/class_const_visibility @reeze created an RFC here and I emailed internals here and didn't get any responses positive/negative.
34 lines
554 B
PHP
34 lines
554 B
PHP
--TEST--
|
|
Class constants and doc comments
|
|
--INI--
|
|
opcache.save_comments=1
|
|
--FILE--
|
|
<?php
|
|
class X {
|
|
/** comment X1 */
|
|
const X1 = 1;
|
|
const X2 = 2;
|
|
/** comment X3 */
|
|
const X3 = 3;
|
|
}
|
|
class Y extends X {
|
|
/** comment Y1 */
|
|
const Y1 = 1;
|
|
const Y2 = 2;
|
|
/** comment Y3 */
|
|
const Y3 = 3;
|
|
}
|
|
$r = new ReflectionClass('Y');
|
|
foreach ($r->getReflectionConstants() as $rc) {
|
|
echo $rc->getName() . " : " . $rc->getDocComment() . "\n";
|
|
}
|
|
|
|
|
|
?>
|
|
--EXPECT--
|
|
Y1 : /** comment Y1 */
|
|
Y2 :
|
|
Y3 : /** comment Y3 */
|
|
X1 : /** comment X1 */
|
|
X2 :
|
|
X3 : /** comment X3 */
|