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