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 @@ -378,9 +378,11 @@ private static function detectConstants($class)
378
378
379
379
do {
380
380
$ scopeConstants = array ();
381
- if (PHP_VERSION_ID >= 70100 ) {
381
+ if (\ PHP_VERSION_ID >= 70100 && method_exists ( ' ReflectionClass ' , ' getReflectionConstants ' ) ) {
382
382
// Since PHP-7.1 visibility modifiers are allowed for class constants
383
383
// for enumerations we are only interested in public once.
384
+ // NOTE: HHVM > 3.26.2 still does not support private/protected constants.
385
+ // It allows the visibility keyword but ignores it.
384
386
foreach ($ reflection ->getReflectionConstants () as $ reflConstant ) {
385
387
if ($ reflConstant ->isPublic ()) {
386
388
$ scopeConstants [ $ reflConstant ->getName () ] = $ reflConstant ->getValue ();
Original file line number Diff line number Diff line change @@ -297,6 +297,9 @@ public function testConstVisibility()
297
297
if (PHP_VERSION_ID < 70100 ) {
298
298
$ this ->markTestSkipped ('This test is for PHP-7.1 and upper only ' );
299
299
}
300
+ if (defined ('HHVM_VERSION ' )) {
301
+ $ this ->markTestSkipped ('HHVM does not support constant visibility ' );
302
+ }
300
303
301
304
$ constants = ConstVisibilityEnum::getConstants ();
302
305
$ this ->assertSame (array (
@@ -310,6 +313,9 @@ public function testConstVisibilityExtended()
310
313
if (PHP_VERSION_ID < 70100 ) {
311
314
$ this ->markTestSkipped ('This test is for PHP-7.1 and upper only ' );
312
315
}
316
+ if (defined ('HHVM_VERSION ' )) {
317
+ $ this ->markTestSkipped ('HHVM does not support constant visibility ' );
318
+ }
313
319
314
320
$ constants = ConstVisibilityEnumExtended::getConstants ();
315
321
$ this ->assertSame (array (
You can’t perform that action at this time.
0 commit comments