Giter VIP home page Giter VIP logo

bitmask's People

Contributors

yaroslavche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bitmask's Issues

Unexpected AssociativeBitMask set method result

Hi,

I like what you've been working on here. Not sure how active the project is for you still but I had an issue to discuss. Hopefully I've missed something here, so before I investigate too much further I thought I would ask you first.

The following test results in an unexpected Exception.

$bitmask = new AssociativeBitMask(['readable', 'writable', 'executable'], 1);

$bitmask->isReadable(); // True
$bitmask->isWritable(); // Exception thrown  "Undefined offset: 1" from line 68 (AssociativeBitMask class).

It looks like the constructor (set() method) is not correctly initialising the internal map property for the AssociativeBitMask.

The above example, yields

map = [
 0 => true
]

But I'd expect,

map = [
 0 => true,
 1 => false,
 2 => false
]

Am I missing something, or does the set() method need to initialise all map values?

A similar issue occurs if the mask value is initially set with all bits on, and then altered.

$bitmask = new AssociativeBitMask(['readable', 'writable', 'executable'], 7);

Correctly generates the following map,

map = [
 0 => true,
 1 => true,
 2 => true
]

Then updating the mask,

$bitmask->set(1);

Yields an unexpected map array,

map = [
 0 => true,
 1 => true,
 2 => true
]

Thanks.

old releases removed

Hi @yaroslavche,

thanks for this package! We saw, that you had removed the old releases. We have a project depending on version 0.2.0. It cannot be upgraded to version 1.0.0, because the minimum php-version changed. Is there a specific reason that you removed the old releases (like a bug, a security-concern, ...)?

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.