php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70076 BitSet::clear(0) should clear the first bit only
Submitted: 2015-07-14 17:11 UTC Modified: -
From: harald dot lapp at gmail dot com Assigned:
Status: Open Package: Bitset (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: harald dot lapp at gmail dot com
New email:
PHP Version: OS:

 

 [2015-07-14 17:11 UTC] harald dot lapp at gmail dot com
Description:
------------
Currently it's impossible to clear the first bit only. Calling BitSet::clear(0) clears the total bitset, which should not happen and is inconsistent with BitSet::set(0). I've prepared a pull request to address this issue at github.

Test script:
---------------
<?php

$a = new BitSet();
$a->set(0, 1);
$a->clear(0);
var_dump((string)$a);


Expected result:
----------------
string(64) "0100000000000000000000000000000000000000000000000000000000000000"

Actual result:
--------------
string(64) "0000000000000000000000000000000000000000000000000000000000000000"

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC