Re: heredoc usage [WAS: <OPTION]
| From: | Nisse Engström | Date: | Sat, 28 Oct 2006 11:28:12 +0000 |
| Subject: | Re: heredoc usage [WAS: <OPTION] | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-243790@lists.php.net to get a copy of this message | ||
On Thu, 26 Oct 2006 01:04:25 -0700, Paul Novitski wrote:
> It's so interesting that some details bug some people and others bug
> others. In an expression such as this:
>
> echo '<option value="' . $day . '"' . $selected .
> '>' . $day
> . '</option>';
>
> ...I count eight transitions (instances of switching between PHP
> syntax and output text) -- one each time you open or close a quote --
> compared to just two transitions (the opening & closing labels) for
> the comparable heredoc statement:
>
> print <<< hdDay
> <option value="$day"$sSelected>$day</option>
>
> hdDay;
>
That's funny. I count eight transitions in both
examples. The difference in the second example is
that the transition switches have changed from
open/closing quote to '$'/not-a-variable-character.
--nfe