Skip to content
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

PHP4-style typed properties not tokenized correctly #2804

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Jan 9, 2020

Typed properties are explicitly also supported for PHP 4-style properties using just the var or static keyword.

However, in that case, the nullable indicator ? was not converted from T_INLINE_THEN to T_NULLABLE.

Fixed now.

Includes unit tests via the File::getMemberProperties() method.

Ref: https://wiki.php.net/rfc/typed_properties_v2

Typed properties are explicitly also supported for PHP 4-style properties using just the `var` or `static` keyword.

However, in that case, the nullable indicator `?` was not converted from `T_INLINE_THEN` to `T_NULLABLE`.

Fixed now.

Includes unit tests via the `File::getMemberProperties()` method.

Ref: https://wiki.php.net/rfc/typed_properties_v2
@gsherwood gsherwood added this to the 3.5.4 milestone Jan 10, 2020
@gsherwood gsherwood changed the title [Hotfix] PHP Tokenizer: bugfix for PHP 7.4 typed properties PHP 4-style typed properties not tokenized correctly Jan 10, 2020
@gsherwood gsherwood changed the title PHP 4-style typed properties not tokenized correctly PHP4-style typed properties not tokenized correctly Jan 10, 2020
gsherwood added a commit that referenced this pull request Jan 10, 2020
@gsherwood gsherwood merged commit e91f880 into squizlabs:master Jan 10, 2020
@gsherwood
Copy link
Member

Thanks

@jrfnl jrfnl deleted the feature/tokenizer-bug-php-74-typed-properties-nullable-with-var branch January 10, 2020 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants