php-src/ext/standard/tests/file/file_get_contents_error002.phpt
Nikita Popov 79484b4f8a Update ext/sockets parameter names
Also change $max_length to $length in a number of filesystem APIs,
where our usage was inconsistent.

Closes GH-6276.
2020-10-06 12:12:43 +02:00

17 lines
462 B
PHP

--TEST--
file_get_contents() test using negative parameter for length (last parameter)
--CREDITS--
"Blanche V.N." <valerie_nare@yahoo.fr>
"Sylvain R." <sracine@phpquebec.org>
--INI--
display_errors=false
--FILE--
<?php
try {
file_get_contents("http://checkip.dyndns.com",null,null,0,-1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
?>
--EXPECT--
file_get_contents(): Argument #5 ($length) must be greater than or equal to 0