~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/spl/tests/bug31926.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Bug #31926 (php in free() error with RecursiveArrayIterator)
 
3
--FILE--
 
4
<?php
 
5
 
 
6
$array = array(0 => array('world'));
 
7
 
 
8
class RecursiveArrayIterator extends ArrayIterator implements
 
9
RecursiveIterator {
 
10
   function hasChildren() {
 
11
       return (is_array($this->current()));
 
12
   }
 
13
 
 
14
   function getChildren() {
 
15
       return new self($this->current());
 
16
   }
 
17
}
 
18
 
 
19
$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));
 
20
foreach($it as $key => $val) {
 
21
   var_dump($key, $val);
 
22
}
 
23
 
 
24
?>
 
25
--EXPECT--
 
26
int(0)
 
27
string(5) "world"