1--TEST--
2Directory class behaviour.
3--FILE--
4<?php
5/*
6 * Prototype: object dir(string directory[, resource context])
7 * Description: Directory class with properties, handle and class and methods read, rewind and close
8 * Class is defined in ext/standard/dir.c
9 */
10
11echo "Structure of Directory class:\n";
12$rc = new ReflectionClass("Directory");
13echo $rc;
14
15echo "Cannot instantiate a valid Directory directly:\n";
16$d = new Directory(getcwd());
17var_dump($d);
18var_dump($d->read());
19
20?>
21--EXPECTF--
22Structure of Directory class:
23Class [ <internal%s> class Directory ] {
24
25  - Constants [0] {
26  }
27
28  - Static properties [0] {
29  }
30
31  - Static methods [0] {
32  }
33
34  - Properties [0] {
35  }
36
37  - Methods [3] {
38    Method [ <internal:standard> public method close ] {
39
40      - Parameters [1] {
41        Parameter #0 [ <optional> $dir_handle ]
42      }
43    }
44
45    Method [ <internal:standard> public method rewind ] {
46
47      - Parameters [1] {
48        Parameter #0 [ <optional> $dir_handle ]
49      }
50    }
51
52    Method [ <internal:standard> public method read ] {
53
54      - Parameters [1] {
55        Parameter #0 [ <optional> $dir_handle ]
56      }
57    }
58  }
59}
60Cannot instantiate a valid Directory directly:
61object(Directory)#%d (0) {
62}
63
64Warning: Directory::read(): Unable to find my handle property in %s on line 15
65bool(false)
66