[PHP-DEV] Language consistency question From: Brian Schaffner (brian <email protected>)
Date: 05/08/98

I just started reviewing part of the manuscript for "Practical PHP" by Chad
Robinson and Graeme Merrall. As I started reading it, it was clear that
there are some heavy PHP2 influences in the PHP3 code. My question is, as
the developers of PHP3, is it considered more "correct" in PHP3 to do:

        echo "Hello World!\n";

*OR*
        echo("Hello World!\n");

The issue is consistency. Since most PHP3 functions are of the form
funcname(var1, var2, ...), it seems that the "most technically accurate"
method of using echo is to use parenthesis. Isn't the non-parenthetical
calling method only included for backwards compatibility?

I guess this is like the c-style printf vs. c++ style cout "debate".
Obviously they both get the job done, but one is more "stylisticly
correct". This applies to the "if; else; endif;" vs. "if {} else {}"
conventions as well...

Then again, maybe I'm just being anal... :-)

Thanks for any input!

-Brian Schaffner-

Brian Schaffner <brian <email protected>>
   Independent Software Contractor
          www.schaffner.net