Skip to content

Commit

Permalink
Fix readonly_modifier() test for PHP 8.4
Browse files Browse the repository at this point in the history
We really should be supporting the new asymmetric visibility modifiers, but
this needs to be done in a separate pull request
  • Loading branch information
thekid committed Dec 31, 2024
1 parent dead44e commit 8dc763f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test/php/lang/unittest/FieldModifiersTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public function static_modifier() {

#[Test, Runtime(php: '>=8.1')]
public function readonly_modifier() {
Assert::equals(MODIFIER_READONLY | MODIFIER_PUBLIC, $this->field('public readonly int $fixture;')->getModifiers());

// Remove implicit protected(set) returned by PHP 8.4
$modifiers= $this->field('public readonly int $fixture;')->getModifiers() & ~0x800;
Assert::equals(MODIFIER_READONLY | MODIFIER_PUBLIC, $modifiers);
}
}

0 comments on commit 8dc763f

Please sign in to comment.