rfc:const_scalar_expressions

Differences

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

Link to this comparison view

Next revision
Previous revision
rfc:const_scalar_expressions [2013/08/13 16:09] – created ircmaxellrfc:const_scalar_expressions [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 3: Line 3:
   * Date: 2013-08-13   * Date: 2013-08-13
   * Author: Anthony Ferrara <ircmaxell@php.net>   * Author: Anthony Ferrara <ircmaxell@php.net>
-  * Status: Draft+  * Status: Withdrawn
   * First Published at: http://wiki.php.net/rfc/const_scalar_expressions   * First Published at: http://wiki.php.net/rfc/const_scalar_expressions
  
Line 35: Line 35:
  
 Also supported is grouping static operations: //(1 + 2) + 3//. Also supported is grouping static operations: //(1 + 2) + 3//.
 +
 +==== Supported Operands ====
 +
 +  * //123// - Integers
 +  * //123.456// - Floats
 +  * //"foo"// - Strings
 +  * //<nowiki>__LINE__</nowiki>// - Line magic constant
 +  * //<nowiki>__FILE__</nowiki>// - File magic constant
 +  * //<nowiki>__DIR__</nowiki>// - Directory magic constant
 +  * //<nowiki>__TRAIT__</nowiki>// - Trait magic constant
 +  * //<nowiki>__METHOD__</nowiki>// - Method magic constant
 +  * //<nowiki>__FUNCTION__</nowiki>// - Function magic constant
 +  * //<nowiki>__NAMESPACE__</nowiki>// - Namespace magic constant
 +  * //<nowiki><<<HEREDOC</nowiki>// - HEREDOC string syntax
  
 ==== Constant Declarations ==== ==== Constant Declarations ====
Line 72: Line 86:
             "bar"             "bar"
     ];     ];
 +    public $baseDir = __DIR__ . "/base";
 } }
 ?> ?>
Line 90: Line 105:
 <?php <?php
 function foo() { function foo() {
-    static $a = 1 + 1; +    static $a = 1 + 1  
-    static $b = [ 1 << 2 ];+    static $b = [ 1 << 2 ];    
 } }
 ?> ?>
Line 129: Line 144:
  
 This patch is ready to be merged with tests. This patch is ready to be merged with tests.
- 
rfc/const_scalar_expressions.1376410179.txt.gz · Last modified: 2017/09/22 13:28 (external edit)