rfc:heredoc-with-double-quotes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:heredoc-with-double-quotes [2008/03/28 14:58] – +1 from Gwynne Raskind lstrojny | rfc:heredoc-with-double-quotes [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Request for Comments: Allow HEREDOC syntax with double quotes ===== | ===== Request for Comments: Allow HEREDOC syntax with double quotes ===== | ||
- | * **Version: | + | * **Version: |
* **Date:** 2008-03-22 | * **Date:** 2008-03-22 | ||
* **Author:** Lars Strojny | * **Author:** Lars Strojny | ||
- | * **Status:** [[http:// | + | * **Status:** [[http:// |
- | * **Votes:** (3 pro/4 contra) | + | * **Votes:** (+6/-4) |
+ | * **Pro:** [[http:// | ||
+ | * **Contra:** [[http:// | ||
==== Purpose ==== | ==== Purpose ==== | ||
Line 17: | Line 19: | ||
=== Classic HEREDOC === | === Classic HEREDOC === | ||
<code php> | <code php> | ||
- | $var = "Hello world"; | + | $var = 'Hello world'; |
$str = <<< | $str = <<< | ||
$var | $var | ||
LABEL; | LABEL; | ||
+ | |||
+ | echo $str; // gives: Hello world | ||
</ | </ | ||
- | " | + | " |
=== NOWDOC === | === NOWDOC === | ||
<code php> | <code php> | ||
+ | $var = 'Hello world'; | ||
+ | |||
$str = <<<' | $str = <<<' | ||
$var | $var | ||
LABEL; | LABEL; | ||
+ | |||
+ | echo $str; // gives: $var | ||
</ | </ | ||
- | " | + | " |
=== Proposed HEREDOC === | === Proposed HEREDOC === | ||
Line 40: | Line 48: | ||
$var | $var | ||
LABEL; | LABEL; | ||
+ | |||
+ | echo $str; // gives: Hello world | ||
</ | </ | ||
- | " | + | " |
rfc/heredoc-with-double-quotes.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1