rfc:heredoc-with-double-quotes

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
Last revisionBoth sides next revision
rfc:heredoc-with-double-quotes [2008/03/28 13:21] – Adding link to the thread lstrojnyrfc:heredoc-with-double-quotes [2013/10/29 17:30] – -> Implemented nikic
Line 1: Line 1:
 ===== Request for Comments: Allow HEREDOC syntax with double quotes ===== ===== Request for Comments: Allow HEREDOC syntax with double quotes =====
  
-  * **Version:** 0.1+  * **Version:** 0.1.1
   * **Date:** 2008-03-22   * **Date:** 2008-03-22
   * **Author:** Lars Strojny   * **Author:** Lars Strojny
-  * **Status:** [[http://marc.info/?l=php-internals&m=120621710002231&w=2|Under Discussion]]+  * **Status:** [[http://news.php.net/php.zend-engine.cvs/6597|Implemented in PHP 5.3]] 
 +  * **Votes:** (+6/-4) 
 +    * **Pro:** [[http://marc.info/?l=php-internals&m=120679140717702&w=2|Pierre A. Joye]], [[http://marc.info/?l=php-internals&m=120674698503890&w=2|Felipe Pena]] , [[http://marc.info/?l=php-internals&m=120636366616273&w=2|Marcus Boerger]], [[http://marc.info/?l=php-internals&m=120671376003536&w=2|Gwynne Raskind]], Christopher Jones, Lars Strojny 
 +    * **Contra:** [[http://marc.info/?l=php-internals&m=120623748226109&w=2|Steph Fox]], [[http://marc.info/?l=php-internals&m=120623999628496&w=2|Edward Z. Yang]], [[http://marc.info/?l=php-internals&m=120627311627368&w=2|Hannes Magnusson]], [[http://marc.info/?l=php-internals&m=120623665525308&w=2|Stanislav Malyshev]]
  
 ==== Purpose ==== ==== Purpose ====
Line 16: Line 19:
 === Classic HEREDOC === === Classic HEREDOC ===
 <code php> <code php>
-$var = "Hello world";+$var = 'Hello world';
  
 $str = <<<LABEL $str = <<<LABEL
 $var $var
 LABEL; LABEL;
 +
 +echo $str; // gives: Hello world
 </code> </code>
-"$var" is evaluated+"$var" is interpreted.
  
 === NOWDOC === === NOWDOC ===
 <code php> <code php>
 +$var = 'Hello world';
 +
 $str = <<<'LABEL' $str = <<<'LABEL'
 $var $var
 LABEL; LABEL;
 +
 +echo $str; // gives: $var
 </code> </code>
-"$var" is taken literally+"$var" is taken literally.
  
 === Proposed HEREDOC === === Proposed HEREDOC ===
Line 39: Line 48:
 $var $var
 LABEL; LABEL;
 +
 +echo $str; // gives: Hello world
 </code> </code>
  
-"$var" would be intepreted.+"$var" would be interpreted.
rfc/heredoc-with-double-quotes.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1