blob: 1607ab1bdef8f8344c461f7f7f05fb164f874f8c (
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
|
--TEST--
file_put_contents() and invalid parameters
--FILE--
<?php
class foo {
function __toString() {
return __METHOD__;
}
}
$file = dirname(__FILE__)."/file_put_contents.txt";
$context = stream_context_create();
var_dump(file_put_contents($file, $context));
var_dump(file_put_contents($file, new stdClass));
var_dump(file_put_contents($file, new foo));
$fp = fopen($file, "r");
var_dump(file_put_contents($file, "string", 0, $fp));
@unlink($file);
echo "Done\n";
?>
--EXPECTF--
Warning: file_put_contents(): supplied resource is not a valid stream resource in %s on line %d
bool(false)
bool(false)
int(15)
Warning: file_put_contents(): supplied resource is not a valid Stream-Context resource in %s on line %d
int(6)
Done
|