php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25982 Operator Precedence screwed up from 4.3.2 to 4.3.3?
Submitted: 2003-10-25 00:42 UTC Modified: 2003-10-27 17:59 UTC
From: adiu at adis dot on dot ca Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.3 OS: Linux
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: adiu at adis dot on dot ca
New email:
PHP Version: OS:

 

 [2003-10-25 00:42 UTC] adiu at adis dot on dot ca
Description:
------------
My hosting service recently changed from php-4.3.2 to php-4.3.3. In the process a script broke which had been working fine right up until php-4.3.3.

I have a comparison expression where a variable on the left side is compared to an expression which alters the same variable on the right side. See the code details below.

Reproduce code:
---------------
if ($var == ($var = ereg_replace("^\.", "", $var))) {
    $replace = true;
} else {
    $replace = false;
}



Expected result:
----------------
If $var contains "SOMETHING" the expression should be true and if $var contains ".SOMETHING" the expression should be false.  

Actual result:
--------------
The expression is always true, regardless of the content of $var.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-27 17:15 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is to be expected.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 21 14:00:02 2025 UTC