return parse error
| From: | Peter Harkins | Date: | Fri, 13 Apr 2001 07:56:55 +0000 |
| Subject: | return parse error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48420@lists.php.net to get a copy of this message | ||
This generates a parse error:
mysql_connect("localhost", "root", "rootpw") or
return("bar");
But all the following work fine:
mysql_connect("localhost", "root", "rootpw") or
die("bar");
mysql_connect("localhost", "root", "rootpw") or
print("bar");
if (!mysql_connect("localhost", "root", "rootpw")) {
return("bar");
}
Why? mysql_connect returns false on failure either way... I notice die
and print are functions but return seems not to be, it doesn't have a
'function.[name].html' file in the manual. *scratches head* I can't see
any reason in the manual for this behavior. Am I missing something?
PHP is running on Linux 2.2.19 and identifies as '4.0.2'. phpinfo also
says:
'./configure' '--with-mysql' '--with-apache=../apache_1.3.12' '--
enable-track-vars' '--disable-debug' '--disable-xml'