File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -351,9 +351,11 @@ private static function detectConstants($class)
351
351
352
352
do {
353
353
$ scopeConstants = [];
354
- if (\PHP_VERSION_ID >= 70100 ) {
354
+ if (\PHP_VERSION_ID >= 70100 && method_exists (ReflectionClass::class, ' getReflectionConstants ' ) ) {
355
355
// Since PHP-7.1 visibility modifiers are allowed for class constants
356
356
// for enumerations we are only interested in public once.
357
+ // NOTE: HHVM > 3.26.2 still does not support private/protected constants.
358
+ // It allows the visibility keyword but ignores it.
357
359
foreach ($ reflection ->getReflectionConstants () as $ reflConstant ) {
358
360
if ($ reflConstant ->isPublic ()) {
359
361
$ scopeConstants [ $ reflConstant ->getName () ] = $ reflConstant ->getValue ();
Original file line number Diff line number Diff line change @@ -388,6 +388,9 @@ public function testConstVisibility()
388
388
if (PHP_VERSION_ID < 70100 ) {
389
389
$ this ->markTestSkipped ('This test is for PHP-7.1 and upper only ' );
390
390
}
391
+ if (defined ('HHVM_VERSION ' )) {
392
+ $ this ->markTestSkipped ('HHVM does not support constant visibility ' );
393
+ }
391
394
392
395
$ constants = ConstVisibilityEnum::getConstants ();
393
396
$ this ->assertSame (array (
@@ -401,6 +404,9 @@ public function testConstVisibilityExtended()
401
404
if (PHP_VERSION_ID < 70100 ) {
402
405
$ this ->markTestSkipped ('This test is for PHP-7.1 and upper only ' );
403
406
}
407
+ if (defined ('HHVM_VERSION ' )) {
408
+ $ this ->markTestSkipped ('HHVM does not support constant visibility ' );
409
+ }
404
410
405
411
$ constants = ConstVisibilityEnumExtended::getConstants ();
406
412
$ this ->assertSame (array (
You can’t perform that action at this time.
0 commit comments