summaryrefslogtreecommitdiff
path: root/ext/bz2/tests/002.phpt
blob: a69514a71132c9cbd5fe727cb09c4128bd266cef (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
--TEST--
bzopen() using fd opened in wrong mode
--SKIPIF--
<?php if (!extension_loaded("bz2")) print "skip"; ?>
--FILE--
<?php

@unlink("bz_open_002.txt");

$fp = fopen("bz_open_002.txt", "w");
var_dump(bzopen($fp, "w"));

$fp = fopen("bz_open_002.txt", "r");
var_dump(bzopen($fp, "r"));

@unlink("bz_open_002.txt");
$fp = fopen("bz_open_002.txt", "x");
var_dump(bzopen($fp, "w"));

@unlink("bz_open_002.txt");
$fp = fopen("bz_open_002.txt", "x");
var_dump(bzopen($fp, "r"));

$fp = fopen("bz_open_002.txt", "rb");
var_dump(bzopen($fp, "r"));

$fp = fopen("bz_open_002.txt", "wb");
var_dump(bzopen($fp, "w"));

$fp = fopen("bz_open_002.txt", "br");
var_dump(bzopen($fp, "r"));

$fp = fopen("bz_open_002.txt", "br");
var_dump(bzopen($fp, "w"));

$fp = fopen("bz_open_002.txt", "r");
var_dump(bzopen($fp, "w"));

$fp = fopen("bz_open_002.txt", "w");
var_dump(bzopen($fp, "r"));

$fp = fopen("bz_open_002.txt", "rw");
var_dump(bzopen($fp, "w"));

$fp = fopen("bz_open_002.txt", "rw");
var_dump(bzopen($fp, "r"));

$fp = fopen("bz_open_002.txt", "wr");
var_dump(bzopen($fp, "w"));

$fp = fopen("bz_open_002.txt", "wr");
var_dump(bzopen($fp, "r"));

$fp = fopen("bz_open_002.txt", "r+");
var_dump(bzopen($fp, "r"));

$fp = fopen("bz_open_002.txt", "r+");
var_dump(bzopen($fp, "w"));

$fp = fopen("bz_open_002.txt", "w+");
var_dump(bzopen($fp, "r"));

$fp = fopen("bz_open_002.txt", "w+");
var_dump(bzopen($fp, "w"));

$fp = fopen("bz_open_002.txt", "a");
var_dump(bzopen($fp, "r"));

$fp = fopen("bz_open_002.txt", "a");
var_dump(bzopen($fp, "w"));

@unlink("bz_open_002.txt");

echo "Done\n";
?>
--EXPECTF--
resource(%d) of type (stream)
resource(%d) of type (stream)
resource(%d) of type (stream)

Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
bool(false)
resource(%d) of type (stream)
resource(%d) of type (stream)

Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d

Warning: bzopen(): first parameter has to be string or file-resource in %s on line %d
bool(false)

Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d

Warning: bzopen(): first parameter has to be string or file-resource in %s on line %d
bool(false)

Warning: bzopen(): cannot write to a stream opened in read only mode in %s on line %d
bool(false)

Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
bool(false)

Warning: bzopen(): cannot use stream opened in mode 'rw' in %s on line %d
bool(false)

Warning: bzopen(): cannot use stream opened in mode 'rw' in %s on line %d
bool(false)

Warning: bzopen(): cannot use stream opened in mode 'wr' in %s on line %d
bool(false)

Warning: bzopen(): cannot use stream opened in mode 'wr' in %s on line %d
bool(false)

Warning: bzopen(): cannot use stream opened in mode 'r+' in %s on line %d
bool(false)

Warning: bzopen(): cannot use stream opened in mode 'r+' in %s on line %d
bool(false)

Warning: bzopen(): cannot use stream opened in mode 'w+' in %s on line %d
bool(false)

Warning: bzopen(): cannot use stream opened in mode 'w+' in %s on line %d
bool(false)

Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
bool(false)
resource(%d) of type (stream)
Done