-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement property hooks syntax #45
Conversation
@@ -3,6 +3,7 @@ | |||
class Property extends Annotated implements Member { | |||
public $kind= 'property'; | |||
public $name, $modifiers, $expression, $type, $holder; | |||
public $hooks= null; |
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.
We are not adding this as constructor parameter partly in order to prevent a BC break, partly because of how parsing works.
Consistency with PHP
…into feature/property-hooks
The RFC has been accepted, however php/php-src#13455 isn't merged at the time of writing, so we don't have a reference implementation quite ready yet for testing this thorougly. |
This pull request adds syntactic support for property hooks.
get, set { <statements> }
get, set => <expr>
$prop => <expr>
set($value)
set(string $value)
final get|set
set; get;
(see here)See https://wiki.php.net/rfc/property-hooks