Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8005963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:21:32+00:00 2026-06-04T17:21:32+00:00

Given two Judy instances, how can the non-static methods size() and count() on any

  • 0

Given two Judy instances, how can the non-static methods size() and count() on any of the two instances be returning what seems to be the sum of all elements on judy arrays in the same PHP process?

Is this intentional? Nothing seems to be pointing to this in documentation. Did i miss something?
See Unit test below. testSizeConsistent() fails, others pass, including testIsSizeSum()

class JudyTest extends PHPUnit_Framework_TestCase {

    private $a, $b;

    public function setUp() {

        $this->a = new Judy(Judy::STRING_TO_MIXED);
        $this->b = new Judy(Judy::STRING_TO_MIXED);
    }

    public function testSizeConsistent() {

        // lets populate a 
        $this->a->offsetSet("foo", "bar");
        $this->a->offsetSet("another", "value");

        // b couldn't have possibly grown?
        $this->assertTrue($this->b->size() === 0);

    }

    public function testSizeZero() {

        $this->assertTrue($this->a->size() === 0);
        $this->assertTrue($this->b->size() === 0);

    }

    public function testIsSizeSum() {

        $this->a->offsetSet("foo", "bar");
        $this->a->offsetSet("another", "value");
        $this->b->offsetSet("third", "..");

        $this->assertTrue($this->b->size() === 3);

    }


}

( i am using the latest “beta” stability Judy array php module from pecl (pecl.php.net/Judy-0.1.2) and the latest libjudy available in macports ( judy @1.0.5 (devel) ) on OS X Lion )

thanks!
Andras

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:21:35+00:00Added an answer on June 4, 2026 at 5:21 pm

    This was definitely a bug. A fix has been released, please give a try:

    • http://pecl.php.net/package/Judy/0.1.3
    • https://github.com/orieg/php-judy/issues/1
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given two implementations of Comparison methods: // compares by Key... private static int CompareByKey(KeyValuePair<int,
Given two IEnumerable s of the same size, how can I convert it to
Given two identical boost::variant instances a and b , the expression ( a ==
Given two methods on the same class in Java : public void doSomething( Person
Given two sorted arrays: A and B . The size of array A is
Given two DOM elements, say a and b, how can we determine which comes
Given two arrays A[n] and B[m] , how can I find the smallest window
Given two unsigned integers, what is the fastest way to count the number of
given two sequences, how to get all the elements belonging to both the sequences
Given two separate emacs buffers, how can I combine them by joining the first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.