|
Mantis - Quercus
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 3239 | major | always | 01-12-09 12:10 | 01-15-09 17:00 | |
|
|
|||||
| Reporter: | haplo | Platform: | |||
| Assigned To: | ferg | OS: | |||
| Priority: | normal | OS Version: | |||
| Status: | closed | Product Version: | 3.2.1 | ||
| Product Build: | Resolution: | fixed | |||
| Projection: | none | ||||
| ETA: | none | Fixed in Version: | 4.0.0 | ||
|
|
|||||
| 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 |
||||
| Steps To Reproduce: | |||||
| Additional Information: | |||||
| Relationships | |||||
| Attached Files: | |||||
| Notes | |||||
|
|
|||||
|
|
||||