php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #39692 [chm] bug on language.operators.html
Submitted: 2006-11-30 14:36 UTC Modified: 2006-11-30 14:45 UTC
From: RQuadling@php.net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant 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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: RQuadling@php.net
New email:
PHP Version: OS:

 

 [2006-11-30 14:36 UTC] RQuadling@php.net
Description:
------------
I have found a bug on page language.operators.html
[chm date: 2006-11-21]...

In the list of assignment operators (= += -= *= /= .= %= &= |= ^= <<= >>=), shouldn't &= actually be =&?

In testing ...

Reproduce code:
---------------
<?php
$a = 1;
$b =& $a;
$c &= $a;

echo $a, $b, $c;
++$a;
echo $a, $b, $c;
?>

Expected result:
----------------
111222

Actual result:
--------------
Notice: Undefined variable: c in D:\PHP Quickies\assignment_test.php on line 4
110220

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-30 14:43 UTC] rquadling@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2006-11-30 14:45 UTC] arpad@php.net
You're confusing the bitwise AND assignment operator (&=) with assigning a reference.

$a &= $b;

can be rewritten as:

$a = $a & $b;

Assigning a reference uses two separate operators, = and &, so it's not listed individually.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 21:01:30 2024 UTC