Anonymous | Login | Signup for a new account | 12-17-2024 11:43 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0003239 | [Quercus] | major | always | 01-12-09 12:10 | 01-15-09 17:00 | ||||
Reporter | haplo | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.2.1 | ||||||
Summary | 0003239: Using custom ArrayIterator leeds to a StackOverflowError | ||||||||
Description |
This throws an StackOverflow : class Iteratable implements IteratorAggregate { private $data = array(); public function __construct(){ $this->data['key1'] = 'value1'; $this->data['key2'] = 'value2'; $this->data['key3'] = 'value3'; $this->data['key4'] = 'value4'; $this->data['key5'] = 'value5'; } public function getData(){ return $this->data; } public function getIterator(){ return new MyIterator($this); } } class MyIterator extends ArrayIterator{ private $iteratable; public function __construct(Iteratable $iteratable){ $this->iteratable = $iteratable; parent::__construct($iteratable->getData()); } } $iteratable = new Iteratable(); foreach($iteratable as $key => $value){ echo "$key => $value \n"; } Result on Apache: key1 => value1 key2 => value2 key3 => value3 key4 => value4 key5 => value5 Quercus throws StackOverflowException Greetings, Peter |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed. 26 unique queries executed. |