ID:               44833
 User updated by:  vmarsik at suse dot cz
 Reported By:      vmarsik at suse dot cz
 Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: SuSE Linux
 PHP Version:      5.2.5
 New Comment:

I quite understand the reason, and have no need to argue with you about
PHP grammatics, even if I find it inconsistent at this point. Languages
like Perl seem to be cleaner in this case.

If you ever considered improving PHP grammatics, this report might
help.


Previous Comments:
------------------------------------------------------------------------

[2008-04-25 18:54:42] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

return( null ) is not a value, it can't be used as one in a logical
expression.

------------------------------------------------------------------------

[2008-04-25 16:42:00] vmarsik at suse dot cz

Description:
------------
$result = mysql_query($sql) or die( mysql_error() );
- works OK

$result = mysql_query($sql) or return( null );
- Parse error: syntax error, unexpected T_RETURN in xx.php on line 24

$result = mysql_query($sql) or $ret = null;
- works OK

$result = mysql_query($sql) or { $ret = null; return $ret; };
- Parse error: syntax error, unexpected '{' in xx.php on line 24

The second version should behave exactly as the first one.
The fourth probably as well.
Also applies to '||', which behaves exactly as 'or'.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=44833&edit=1

Reply via email to