php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6969 operator / assignment presidence
Submitted: 2000-10-01 03:36 UTC Modified: 2000-10-01 03:39 UTC
From: shmengie_2000 at yahoo dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.2 OS: linux
Private report: No CVE-ID: None
 [2000-10-01 03:36 UTC] shmengie_2000 at yahoo dot com
This cought me off guard perhaps a bug:

The && operator takes presidence over the assignment operator =  but the 'and' operator does not.

while($row=dbFetch($cursor) && $i < 20) 

$row=(dbFetch($cursor) && i)

where

while($row=dbFetch($cursor) and $i < 20)

$row=(dbFetch($cursor))

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-01 03:39 UTC] zak@php.net
This is not a bug - it is documented and expected behavior
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Jul 13 16:00:02 2026 UTC