php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24366 Declaring a function without () produces no output
Submitted: 2003-06-27 13:46 UTC Modified: 2003-06-27 13:55 UTC
From: fmaillet at vizfx dot ca Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.1 OS: Windows 2000
Private report: No CVE-ID: None
 [2003-06-27 13:46 UTC] fmaillet at vizfx dot ca
Description:
------------
I'm not sure if this is a bug but I think there should be an error message. When you declare a function and don't add () before the {, you get no output at all, not even an error message.

I posted an exemple of code. I know I'm not calling the function but something should happen. Either "This is a test" being printed or an error concerning the function declaration.

Reproduce code:
---------------
<?

echo "This is a test<br>";

function MyFunction {
     echo "This is an other test";
}

?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-27 13:55 UTC] philip@php.net
I get:
Parse error: parse error, expecting `'('' in /tmp/24366.php on line 6

Be sure to check your error settings, like display_errors and error_reporting.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 07:01:31 2025 UTC