Mantis - Quercus
Viewing Issue Advanced Details
2398 major always 02-04-08 11:45 05-30-08 18:26
lee_saferite  
ferg  
high  
closed 3.1.5  
fixed  
none    
none 3.2.0  
0002398: Cannot extend SPL ArrayObject
When you extend ArrayObject it works, but no values are stored when using the new object.

This is using resin-pro-3.1.s080130
Code:
class Test extends ArrayObject
{
    public function __construct()
    {
        parent::__construct();
    }
}
$one = new ArrayObject();
$two = new Test();
$one['one'] = "one here";
$two['two'] = "two here";
header('Content-Type: text/plain');
var_dump($one);
var_dump($two);

Expected Result:
object(ArrayObject)0000001 (1) {
  ["one"]=>
  string(8) "one here"
}
object(Test)0000002 (1) {
  ["two"]=>
  string(8) "two here"
}

Actual Result:
object(ArrayObject) (1) {
  ["one"]=>
  string(8) "one here"
}
object(Test) (0) {
}

Notes
(0002715)
lee_saferite   
02-04-08 12:27   
I've tried this on 3.1.4a and it exists there as well.
(0002722)
nam   
02-05-08 14:32   
Values are being stored correctly but var_dump/print_r are not printing out the object correctly.
(0002723)
lee_saferite   
02-06-08 06:04   
I tested this and found that to be true.

Unfortunately, that does not explain the fact that Zend_Registry and several other classes from Zend Framework do not work correctly under Quercus.

Zend_Registry simply 'loses' variables you store in it.

Zend_Registry is a simple class, less than 200 lines, that gets most of it's functionality from ArrayObject.

UPDATE: The problem seems to lie in 'array_key_exists', I will file another bug report.
(0002725)
lee_saferite   
02-06-08 06:22   
See issue: 0002404
(0003130)
ferg   
05-30-08 18:26   
php/4a4u