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