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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: slicky at newshelix dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 16:01:28 2025 UTC