Re: What does "<<<" mean?

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

 



Greg Donald wrote:

On 4/30/07, Daevid Vincent <daevid@xxxxxxxxxx> wrote:
> echo <<<EOF
> BROWSER: $_SERVER[HTTP_USER_AGENT]
> EOF;

Isn't that form (sans quote marks) deprecated and frowned upon?

<?php

error_reporting( E_ALL );

echo <<<EOF
BROWSER: $_SERVER[HTTP_USER_AGENT]
EOF;

Why would cleaner, perfectly error free code be frowned upon?

I'm not dissing heredoc syntax, it has its uses (now and again) but it's far from "clean", especially when embedded deep in classes - the major cause being the delimeters insistance on being at the very start of the line. It's just *not* pretty IMHO. Certainly not girl code [1]

The frowning surely would be at the mixing of logic and presentation, regardless how that mix happens (heredoc, echo, jumping in and out of PHP tags, sprintf, etc).

Cheers,

Rich

[1] http://headrush.typepad.com/creating_passionate_users/2006/03/code_like_a_gir.html
--
Zend Certified Engineer
http://www.corephp.co.uk

"Never trust a computer you can't throw out of a window"

--
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