rfc:const_scalar_exprs

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:const_scalar_exprs [2013/11/03 10:49] – [Supported Operations] automated formatting of character sequences is annoying… bwoebirfc:const_scalar_exprs [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== PHP RFC: Constant Scalar Expressions ====== ====== PHP RFC: Constant Scalar Expressions ======
-  * Version: 0.1 
   * Date: 2013-11-03   * Date: 2013-11-03
   * Author: Bob Weinand <bwoebi@php.net>   * Author: Bob Weinand <bwoebi@php.net>
-  * Status: In Draft+  * Status: Implemented in PHP 5.6
   * First Published at: https://wiki.php.net/rfc/const_scalar_exprs   * First Published at: https://wiki.php.net/rfc/const_scalar_exprs
     * This is a follow-up to https://wiki.php.net/rfc/const_scalar_expressions from Anthony Ferrara <ircmaxell@php.net> (which was without constant support)     * This is a follow-up to https://wiki.php.net/rfc/const_scalar_expressions from Anthony Ferrara <ircmaxell@php.net> (which was without constant support)
Line 72: Line 71:
   * //<nowiki>__FUNCTION__</nowiki>// - Function magic constant   * //<nowiki>__FUNCTION__</nowiki>// - Function magic constant
   * //<nowiki>__NAMESPACE__</nowiki>// - Namespace magic constant   * //<nowiki>__NAMESPACE__</nowiki>// - Namespace magic constant
-  * //<nowiki><<<HEREDOC</nowiki>// - HEREDOC string syntax+  * //<nowiki><<<HEREDOC</nowiki>// - HEREDOC string syntax (without variables) 
 +  * //<nowiki><<<'NOWDOC'</nowiki>// - NOWDOC string syntax
   * //SOME_RANDOM_CONSTANT// - Constants   * //SOME_RANDOM_CONSTANT// - Constants
   * //class_name::SOME_CONST// - Class constants   * //class_name::SOME_CONST// - Class constants
Line 140: Line 140:
     static $a = 1 + 1;     static $a = 1 + 1;
     static $b = [1 << 2];     static $b = [1 << 2];
-    static $c = 0x01 BAR;+    static $c = 0x01 BAR;
 } }
 ?> ?>
Line 156: Line 156:
  
 An implementation based off of current master is available: [[https://github.com/bwoebi/php-src/tree/const_scalar_exprs|Implementation On GitHub]] ([[https://github.com/bwoebi/php-src/compare/const_scalar_exprs|Diff On GitHub]]) An implementation based off of current master is available: [[https://github.com/bwoebi/php-src/tree/const_scalar_exprs|Implementation On GitHub]] ([[https://github.com/bwoebi/php-src/compare/const_scalar_exprs|Diff On GitHub]])
 +
 +The patch is ready to be merged. (Opcache support is included, thanks to Dmitry)
 +
 +===== Note on implementation =====
 +
 +The implementation of the scalar expressions is based on an AST. That AST implementation eventually could be used later as a general-purpose AST for compiler with a few tweaks.
 +
 +===== Vote =====
 +
 +<doodle title="Should the patch for this RFC be merged into PHP 5.6?" auth="bwoebi" voteType="single" closed="true">
 +   * Yes
 +   * No
 +</doodle>
 +
 +The vote started the 20th November 2013 and ended the 27th November 2013.
rfc/const_scalar_exprs.1383475775.txt.gz · Last modified: 2017/09/22 13:28 (external edit)