Re: heredoc usage [WAS: <OPTION]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux