Open for debate
Date: 09/13/06
(PHP Community) Keywords: php, browser
I've gotten into a syntax argument with a friend/coworker of mind over the code style I use. To be exact, how I format strings to be printed to the browser.
In my defense, I argue that the below is better for the longer term because it's easier to change/add to the formated string this way.
And he argues that it will slow PHP down having to
function inputString($myID, $myValue)
{
$output = '<'
. 'input type="text"'
. 'size="120"'
. 'maxlength="254"'
. "id=\"$\"$myID"
. "value=\"$myValue\""
. '>';
return $output;
}
Yes this is pretty petty but we got nothing else to do but bitch at each other right now.
His version is to have it all on one line.
Source: http://community.livejournal.com/php/494566.html