in reply to It is not an array!

Guess you didn't bless it, and you used array as the base for your class.
This is easy to check. If you do a print of that object, and it is a class, you would see 'class_name=ARRAY(0xnnnnnnnn), in stead of ARRAY(0xnnnnnnnn). If you use hash as base, it would use the word HASH to replace ARRAY.