php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9631 if(condition); works without warning/error!!
Submitted: 2001-03-08 12:21 UTC Modified: 2001-03-08 12:31 UTC
From: slicky at newshelix dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.4pl1 OS: Windows
Private report: No CVE-ID: None
 [2001-03-08 12:21 UTC] slicky at newshelix dot com
I don't know if you noticed that but 

if(condition); 

works. It won't give out any error or warning, while using the currently latest version (4.04pl/win). 
I don't know if that's the intention of the programmers but IMO it's more likly a bug, since it doesn't make any sense anywhere i could think so far.
Please let me know if that's fixed soon.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-08 12:31 UTC] stas@php.net
Yes, this is a valid construct. The syntax of if operator is:
'if(' expression ')' statement

';' alone is a valid statement (just like in C). So that
code is valid. PHP cannot really determine if it's
"meaningful" or not for you.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 07:01:28 2024 UTC