php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19099 comparison expressions
Submitted: 2002-08-26 03:33 UTC Modified: 2002-08-26 12:10 UTC
From: jacob at emcken dot dk Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.2.2 OS: Debian Linux 2.4
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jacob at emcken dot dk
New email:
PHP Version: OS:

 

 [2002-08-26 03:33 UTC] jacob at emcken dot dk
I am getting errors when executing the following code wich seems to be the right syntax!?
I tested it on 2 other servers running apache and php4

Here are 2 examples of the some code wich should work if i'm not mistaken:
<?
  
  //Test 1
  //This example give a "parse error in line 7"
  $a=2;
  $b=3;
  if($a==$b || $b==3) {
    echo "hey";
  }
  
  //Test 2
  //This example gives the error: "Call to undefined function:  ()"

  $a=2;
  $b=3;
  if(($a==$b) || ($b==3)) {
    echo "hey";
  }
  ?>

I have coded alot of things on the server and this i the first time im have run into trouble.

By the way this code sample runs just fine:

<?
if(false || true) {
  echo "hey";
}

//And this one works just fine also

  $a=2;
  $b=3;
  if($b==3) {
    echo "hey";
  }
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-26 03:39 UTC] cynic@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
 [2002-08-26 04:54 UTC] jacob at emcken dot dk
I have now installed PHP 4.2.2 but the problem is still there...

I use Apache 1.3.26

It seems that the code only makes errors when the if() contains multple expressions like $a==2 and $a == $b it works just fine if I write if(true || flase) or if($a==$b || false)
 [2002-08-26 12:10 UTC] sniper@php.net
Can not reproduce with PHP 4.3.0-dev or 4.2.3-dev.

http://snaps.php.net/php4-latest.tar.gz
http://snaps.php.net/php4-STABLE-latest.tar.gz

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 06:00:01 2026 UTC