summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/popen_pclose_error.phpt
blob: 6c92708dddb74c8026e9eb54735f461473129d08 (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
--TEST--
Test popen() and pclose function: error conditions
--FILE--
<?php

try {
    popen("abc.txt", "x");
} catch (ValueError $exception) {
    echo $exception->getMessage() . "\n";
}

try {
    popen("abc.txt", "rw");
} catch (ValueError $exception) {
    echo $exception->getMessage() . "\n";
}

try {
    popen("abc.txt", "rwb");
} catch (ValueError $exception) {
    echo $exception->getMessage() . "\n";
}

?>
--EXPECT--
popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb"
popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb"
popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb"