-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[RFC] Allow hooks for backed readonly
properties
#18757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
1a21998
to
6840873
Compare
da64264
to
24f2687
Compare
c06c915
to
12b986a
Compare
readonly
propertiesreadonly
properties
int(42) | ||
Cannot modify readonly property Test::$prop | ||
Cannot modify protected(set) readonly property Test::$prop from global scope | ||
int(42) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure to include the trailing newline at EOF (also applies to other tests).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test does not appear to belong to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Cannot modify readonly property Test::$prop | ||
Cannot modify protected(set) readonly property Test::$prop from global scope | ||
int(42) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this appears to be a newline too many.
try { | ||
$t->set(43); | ||
} catch (Error $e) { | ||
echo $e->getMessage(), "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo $e->getMessage(), "\n"; | |
echo $e::class, ": ", $e->getMessage(), PHP_EOL; |
For consistency with other tests (applies to the entire PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated test.
} | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Hooked virtual properties cannot be readonly in %s on line %d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message is misleading.
} | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Hooked virtual properties cannot be readonly in %s on line %d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message is misleading.
https://wiki.php.net/rfc/readonly_hooks
https://news-web.php.net/php.internals/127529