-
Notifications
You must be signed in to change notification settings - Fork 272
Void return type #150
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
Void return type #150
Conversation
|
||
function foobar(void $a) {} | ||
--EXPECTF-- | ||
Fatal error: void cannot be used as a parameter type 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.
Not sure if this test should be included, since a reasonable implementation might consider this a syntax error.
(Also, should we really be testing error messages anyway? They're not in the spec. :/)
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.
Well, not really, we could rewrite the tests to only check if there's exception now. If anybody has the time ;)
e3b9510
to
ad1a8bd
Compare
@@ -269,7 +269,7 @@ Unless stated otherwise ([functions](13-functions.md#function-definitions), | |||
|
|||
Names beginning with two underscores (__) are reserved by the PHP language and should not be defined by the user code. | |||
|
|||
The following names cannot be used as the names of classes, interfaces, or traits: `bool`, `FALSE`, `float`, `int`, `NULL`, `string`, and `TRUE`. | |||
The following names cannot be used as the names of classes, interfaces, or traits: `bool`, `FALSE`, `float`, `int`, `NULL`, `string`, `TRUE` and `void`. |
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.
The Oxford comma went missing here.
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.
Oh, yeah, my bad. Luckily it doesn't make a difference here, though.
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.
@GrahamCampbell I've fixed it: 1935a4b
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.
I already sent a PR though: #151.
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.
Oops, sorry. I guess it'll have to be closed now D:
PHP 7.1 feature: https://wiki.php.net/rfc/void_return_type