RE: [PHP-DEV] [VOTE] var deprecation

From: Date: Fri, 25 Mar 2016 10:51:52 +0000
Subject: RE: [PHP-DEV] [VOTE] var deprecation
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-91938@lists.php.net to get a copy of this message
Hi Dmitry, > Java is going to add "var" (http://openjdk.java.net/jeps/286), we are going to > remove... We're not going to remove the "var" keyword, just deprecate its usage in the context of setting properties as public. The "var" keyword will still remain a reserved word, and it can therefore still be reused in other places if we so wish (as has been done with "use" for namespaces, traits, and closures, as well as "as" in foreach, namespaces, and traits). So whilst Java is adding "var" for a short-hand declaration via type inference, it is only applicable to local variables and not properties. Deprecating "var" in this context for PHP is therefore not really the inverse of what Java is doing. -Tom

« previous php.internals (#91938) next »