-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Add true as a type #8326
Add true as a type #8326
Conversation
0b3f3b4
to
9310e7c
Compare
This comment was marked as abuse.
This comment was marked as abuse.
Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt
Outdated
Show resolved
Hide resolved
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.
LGTM
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.
LGTM, only nits in tests
var_dump(test(true)); | ||
|
||
?> | ||
===DONE=== |
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.
Unnecessary
function test(true $v = null) {} | ||
|
||
?> | ||
===DONE=== |
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.
Might be better to actually pass null and true
…HP 8.2) (bobahvas, alexandre-daubois) This PR was merged into the 6.2 branch. Discussion ---------- [Serializer] Add support of true built-in type (from PHP 8.2) | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - RFC: https://wiki.php.net/rfc/true-type Pull request: php/php-src#8326 Same as this PR to add support of `false` and `null` types: #45981 Commits ------- 2ec0453 [Serializer] Add support of true built-in type (from PHP 8.2)
> Type System Improvements > > The `true` type has been added Detect use of `true` as a parameter type. Ref: * https://wiki.php.net/rfc/true-type * https://www.php.net/manual/en/migration82.new-features.php#migration82.new-features.core.type-system * php/php-src#8326
> Type System Improvements > > The `true` type has been added Detect use of `true` as a return type. Ref: * https://wiki.php.net/rfc/true-type * https://www.php.net/manual/en/migration82.new-features.php#migration82.new-features.core.type-system * php/php-src#8326
> Type System Improvements > > The `true` type has been added Detect use of `true` as a property type. Ref: * https://wiki.php.net/rfc/true-type * https://www.php.net/manual/en/migration82.new-features.php#migration82.new-features.core.type-system * php/php-src#8326
RFC: https://wiki.php.net/rfc/true-type