ID:               49346
 Updated by:       sjo...@php.net
 Reported By:      mirko dot steiner at slashdevslashnull dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Reproducible crash
 Operating System: linux, freebsd
 PHP Version:      5.2.10
 New Comment:

Thank you for your report.

The behavior you report is not a bug. You call return as if it is a
function. It is not, it is a language construct.

The correct syntax is:
return 'bar';
or
return;

The parenthesis are not needed.


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

[2009-08-24 15:20:57] mirko dot steiner at slashdevslashnull dot de

Description:
------------
using return() with an empty argument list is causing in a parser
error.

Reproduce code:
---------------
<?php
function foo($arg) {
    if($arg) {
        return('bar');
    } else {
        return();
    }
}
?>


Expected result:
----------------
no parser error :-)

Actual result:
--------------
Parse error: syntax error, unexpected ')' in 
/usr/local/www/develop/htdocs/test.php on line 6


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


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

Reply via email to