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: 2018-03-29 22:28 UTC
From: harald dot lapp at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Bitset (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
41 - 6 = ?
Subscribe to this entry?

 
 [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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-29 22:28 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2018-03-29 22:28 UTC] cmb@php.net
Apparently, the pull request has been merged, so the ticket can be
closed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 08:01:30 2024 UTC