2 /* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]])
3 * Description: Write/Create a file with contents data and return the number of bytes written
4 * Source code: ext/standard/file.c
11 //correct php53 behaviour is to ignore the FILE_USE_INCLUDE_PATH unless the file already exists
12 // in the include path. In this case it doesn't so the file should be written in the current dir.
14 file_put_contents(ZendGoodExtStandardTestsFileFilePutContentsVariation6
::$filename, (string)"File in include path", FILE_USE_INCLUDE_PATH
);
15 file_put_contents(ZendGoodExtStandardTestsFileFilePutContentsVariation6
::$filename, (string)". This was appended", FILE_USE_INCLUDE_PATH | FILE_APPEND
);
16 $line = file_get_contents(ZendGoodExtStandardTestsFileFilePutContentsVariation6
::$filename);
18 unlink(ZendGoodExtStandardTestsFileFilePutContentsVariation6
::$filename);
21 abstract final class ZendGoodExtStandardTestsFileFilePutContentsVariation6
{
22 public static $filename;
24 <<__EntryPoint
>> function main(): void
{
25 require_once('fopen_include_path.inc');
27 echo "*** Testing file_put_contents() : variation ***\n";
29 $thisTestDir = __SystemLib\
hphp_test_tmppath('dir');
31 $oldDirPath = getcwd();
34 ZendGoodExtStandardTestsFileFilePutContentsVariation6
::$filename = basename(__FILE__
, ".php") . ".tmp";
36 $newpath = create_include_path();
37 set_include_path($newpath);
40 $newpath = generate_next_path();
41 set_include_path($newpath);
44 teardown_include_path();
45 restore_include_path();