Skip to content

Commit

Permalink
Wrapped enum declaration in eval function for better backward compati…
Browse files Browse the repository at this point in the history
…bility.
  • Loading branch information
gordinskiy committed Oct 23, 2024
1 parent 8144e25 commit 316de36
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/AssertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,12 @@ public function __toString()
const ENUM_INTRODUCTION_VERSION_ID = 80100;

if (PHP_VERSION_ID >= ENUM_INTRODUCTION_VERSION_ID) {
enum TestEnum
{
case CaseName;
}
eval('
namespace '.__NAMESPACE__.';
enum TestEnum
{
case CaseName;
}
');
}

0 comments on commit 316de36

Please sign in to comment.