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)
351351
352352 do {
353353 $ scopeConstants = [];
354- if (\PHP_VERSION_ID >= 70100 ) {
354+ if (\PHP_VERSION_ID >= 70100 && method_exists (ReflectionClass::class, ' getReflectionConstants ' ) ) {
355355 // Since PHP-7.1 visibility modifiers are allowed for class constants
356356 // 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.
357359 foreach ($ reflection ->getReflectionConstants () as $ reflConstant ) {
358360 if ($ reflConstant ->isPublic ()) {
359361 $ scopeConstants [ $ reflConstant ->getName () ] = $ reflConstant ->getValue ();
Original file line number Diff line number Diff line change @@ -388,6 +388,9 @@ public function testConstVisibility()
388388 if (PHP_VERSION_ID < 70100 ) {
389389 $ this ->markTestSkipped ('This test is for PHP-7.1 and upper only ' );
390390 }
391+ if (defined ('HHVM_VERSION ' )) {
392+ $ this ->markTestSkipped ('HHVM does not support constant visibility ' );
393+ }
391394
392395 $ constants = ConstVisibilityEnum::getConstants ();
393396 $ this ->assertSame (array (
@@ -401,6 +404,9 @@ public function testConstVisibilityExtended()
401404 if (PHP_VERSION_ID < 70100 ) {
402405 $ this ->markTestSkipped ('This test is for PHP-7.1 and upper only ' );
403406 }
407+ if (defined ('HHVM_VERSION ' )) {
408+ $ this ->markTestSkipped ('HHVM does not support constant visibility ' );
409+ }
404410
405411 $ constants = ConstVisibilityEnumExtended::getConstants ();
406412 $ this ->assertSame (array (
You can’t perform that action at this time.
0 commit comments