View Single Post
Old 05-27-2009, 12:01 PM   #8 (permalink)
ReSpawN
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

Although I still don't see the upside of using print instead of echo, I can at least conclude that using () after echo and print is completely and utterly useless. They, when working with frameworks, components or even large script, they take up more bytes and therefore, the script becomes larger and takes longer to process.
When I see people's scripts with;
PHP Code:
echo ( 'My Echo' );
// and of course ...
print ( 'My print (duh..)' ); 
I find it a excessive use of overhead. When compared,
PHP Code:
echo 'My echo';
// and of course ...
print 'My print (duh..)'
...is a lot more easier on the eyes, very much so if you're working between if/elseif/else, for, foreach, while, switch and other functions. Use () only when you absolutely need to. :)

And yes, echo processes just slightly better than print, but it isn't notable. Create your own script and test it out on your own server (or XAMP, WAMP) using;
PHP Code:
$timer['start'] = microtime();
echo 
'a';
echo 
'a';
echo 
'a';
// Couple of hundred times...
echo 'a';
echo 
'a';
echo 
'a';
$timer['end'] = microtime(); 
And compare those diffirences.

ReSpawN
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote