~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
ImportĀ upstreamĀ versionĀ 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
SPL: FixedArray: overriden iterator methods
 
3
--FILE--
 
4
<?php
 
5
class SplFixedArray2 extends SplFixedArray {
 
6
    public function rewind() {
 
7
        echo "rewind\n";
 
8
        return parent::rewind();
 
9
    }
 
10
    public function valid() {
 
11
        echo "valid\n";
 
12
        return parent::valid();
 
13
    }
 
14
    public function next() {
 
15
        echo "next\n";
 
16
        return parent::next();
 
17
    }
 
18
    public function current() {
 
19
        echo "current\n";
 
20
        return parent::current();
 
21
    }
 
22
    public function key() {
 
23
        echo "key\n";
 
24
        return parent::key();
 
25
    }
 
26
}
 
27
 
 
28
$fa = new SplFixedArray2(3);
 
29
foreach($fa as $k=>$v) {
 
30
    echo "$k=>";
 
31
    var_dump($v);
 
32
}
 
33
?>
 
34
--EXPECT--
 
35
rewind
 
36
valid
 
37
current
 
38
key
 
39
0=>NULL
 
40
next
 
41
valid
 
42
current
 
43
key
 
44
1=>NULL
 
45
next
 
46
valid
 
47
current
 
48
key
 
49
2=>NULL
 
50
next
 
51
valid