--- "Chris W. Parker" <[EMAIL PROTECTED]> wrote:
> I also prefer <?= $variable ?> to <?php echo $variable; ?> except
> that for the sake of cross-system compatibility* I now choose to do
> <?php echo $variable; ?>.

I think explicitly using echo is much more readable. While it may be
obvious to many what <?= does, it is one more little thing that might seem
like magic to someone else. The less of that type of syntax, the better,
in my opinion. If you want magic syntax, there's Perl. It has a lot of
great shortcuts, if you're familiar with the syntax. With PHP, most things
you don't understand are easy to look up. I'd rather search for "echo"
than "<?=" if I was new to PHP.

> * What I mean by that is if I give my code to someone else I want it
> to work with as few changes as possible. Some php installs don't have
> <? ?> turned on (short tags?).

Right, plus I don't think <?php= will work (you might have been suggesting
this). This was discussed on the internals list a year or two ago, and it
was voted down.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/
RAMP Training Courses
     http://www.nyphp.org/ramp

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

Reply via email to