php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #71268 Adding variable type key words: variant, object, void
Submitted: 2016-01-03 17:21 UTC Modified: 2016-01-04 01:02 UTC
From: furun at arcor dot de Assigned:
Status: Wont fix Package: Variables related
PHP Version: 7.0.1 OS: Win7 XAMPP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
40 - 39 = ?
Subscribe to this entry?

 
 [2016-01-03 17:21 UTC] furun at arcor dot de
Description:
------------
It would improve explicitly to add the key words 
"variant" (for function parameter/return variable type, for any type),
"object" (for function parameter/return variable type),
"void" (for function return variable type)

function Example (variant var1) : void {
	return;
}



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-01-04 01:02 UTC] requinix@php.net
-Status: Open +Status: Wont fix -Package: *Programming Data Structures +Package: Variables related
 [2016-01-04 01:02 UTC] requinix@php.net
"variant" is the same as not using a hint.
"object" doesn't say much: have a class/interface hint or don't use one at all.
"void" was added in 7.1. https://wiki.php.net/rfc/void_return_type
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC