Jump to content

Shortcuts


bundyxc

Recommended Posts

I see this a lot:

$con = mysql_connect($setHostname,$setUsername,$setPassword);
if (!$con)
{
die (mysql_error());
}

 

But is there any reason not to just do this?

 

if (!$con = mysql_connect($setHostname,$setUsername,$setPassword))
{
die (mysql_error());
}

 

It seems like everybody freaks out over typing an extra five characters.. is there a reason not to just do the second example?

Link to comment
https://forums.phpfreaks.com/topic/168924-shortcuts/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.