1--TEST--
2putenv() basic tests
3--FILE--
4<?php
5
6$var_name="SUCHVARSHOULDNOTEXIST";
7
8var_dump(getenv($var_name));
9var_dump(putenv($var_name."=value"));
10var_dump(getenv($var_name));
11
12var_dump(putenv($var_name."="));
13var_dump(getenv($var_name));
14
15var_dump(putenv($var_name));
16var_dump(getenv($var_name));
17
18try {
19    putenv("=123");
20} catch (ValueError $exception) {
21    echo $exception->getMessage() . "\n";
22}
23
24try {
25    putenv("");
26} catch (ValueError $exception) {
27    echo $exception->getMessage() . "\n";
28}
29
30echo "Done\n";
31?>
32--EXPECT--
33bool(false)
34bool(true)
35string(5) "value"
36bool(true)
37string(0) ""
38bool(true)
39bool(false)
40putenv(): Argument #1 ($assignment) must have a valid syntax
41putenv(): Argument #1 ($assignment) must have a valid syntax
42Done
43