rfc:uniform_variable_syntax

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
rfc:uniform_variable_syntax [2014/07/30 00:03] – Whatever we'd both like it to have been, this is for 7, not 6 ;) ajfrfc:uniform_variable_syntax [2014/08/27 18:06] – -> Implemented nikic
Line 2: Line 2:
   * Date: 2014-05-31   * Date: 2014-05-31
   * Author: Nikita Popov <nikic@php.net>   * Author: Nikita Popov <nikic@php.net>
-  * Status: Accepted (for PHP 7)+  * Status: Implemented (in PHP 7)
   * Discussion: http://markmail.org/message/mr4ihbubfbdxygci   * Discussion: http://markmail.org/message/mr4ihbubfbdxygci
  
Line 276: Line 276:
 </code> </code>
  
-This change is **backwards incompatible** (with low practical impact), which is the reason why this RFC targets PHP 6.+This change is **backwards incompatible** (with low practical impact), which is the reason why this RFC targets PHP 7.
 However it is always possible to recreate the old behavior by explicitly using braces: However it is always possible to recreate the old behavior by explicitly using braces:
  
Line 285: Line 285:
 </code> </code>
  
-This syntax will have guaranteed same behavior in both PHP 5 and PHP 6.+This syntax will have guaranteed same behavior in both PHP 5 and PHP 7.
  
 ==== Newly added and generalized syntax ==== ==== Newly added and generalized syntax ====
Line 357: Line 357:
 occurrence of ''%%$loader[0]::$loader[1]($className)%%'' in the Doctrine class loader will be affected by this change. occurrence of ''%%$loader[0]::$loader[1]($className)%%'' in the Doctrine class loader will be affected by this change.
 This occurrence must be replaced with ''%%$loader[0]::{$loader[1]}($className)%%'' to achieve compatibility with both This occurrence must be replaced with ''%%$loader[0]::{$loader[1]}($className)%%'' to achieve compatibility with both
-PHP 5 and PHP 6.+PHP 5 and PHP 7.
  
 The latter change turns currently valid syntax into a parse error. Expressions like ''%%global $$foo->bar%%'' are no The latter change turns currently valid syntax into a parse error. Expressions like ''%%global $$foo->bar%%'' are no
 longer valid and ''%%global ${$foo->bar}%%'' must be used instead. longer valid and ''%%global ${$foo->bar}%%'' must be used instead.
  
-As these changes only apply to some very rarely used syntax, the breakage seems acceptable for PHP 6.+As these changes only apply to some very rarely used syntax, the breakage seems acceptable for PHP 7.
  
 ===== Open issues ===== ===== Open issues =====
rfc/uniform_variable_syntax.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1