1--TEST--
2mail() with null bytes in arguments
3--FILE--
4<?php
5
6try {
7    mail("foo\0bar", "x", "y");
8} catch (ValueError $e) {
9    echo $e->getMessage(), "\n";
10}
11try {
12    mail("x", "foo\0bar", "y");
13} catch (ValueError $e) {
14    echo $e->getMessage(), "\n";
15}
16try {
17    mail("x", "y", "foo\0bar");
18} catch (ValueError $e) {
19    echo $e->getMessage(), "\n";
20}
21try {
22    mail("x", "y", "z", "foo\0bar");
23} catch (ValueError $e) {
24    echo $e->getMessage(), "\n";
25}
26try {
27    mail("x", "y", "z", "q", "foo\0bar");
28} catch (ValueError $e) {
29    echo $e->getMessage(), "\n";
30}
31
32?>
33--EXPECT--
34mail(): Argument #1 ($to) must not contain any null bytes
35mail(): Argument #2 ($subject) must not contain any null bytes
36mail(): Argument #3 ($message) must not contain any null bytes
37mail(): Argument #4 ($additional_headers) must not contain any null bytes
38mail(): Argument #5 ($additional_params) must not contain any null bytes
39