2 /* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
3 * Description: Open a file or a URL and return a file pointer
4 * Source code: ext/standard/file.c
11 $extraDir = "extraDir16";
13 mkdir(ZendGoodExtStandardTestsFileFopenIncludePathInc
::dir1().'/'.$extraDir);
16 $tmpfile = $extraDir.'/fopen_variation16.tmp';
18 $h = fopen($tmpfile, "w+", true);
19 fwrite($h, (string)"This is the test file");
22 $h = @fopen
(ZendGoodExtStandardTestsFileFopenIncludePathInc
::dir1().'/'.$tmpfile, "r");
24 echo "Not created in dir1\n";
27 echo "created in dir1\n";
31 $h = fopen($tmpfile, "r", true);
33 echo "could not find file for reading\n";
36 echo "found file - not in dir1\n";
41 rmdir(ZendGoodExtStandardTestsFileFopenIncludePathInc
::dir1().'/'.$extraDir);
44 <<__EntryPoint
>> function main(): void
{
45 require_once('fopen_include_path.inc');
46 $thisTestDir = __SystemLib\
hphp_test_tmppath('fopenVariation16.dir');
49 $oldDirPath = getcwd();
52 $newpath = create_include_path();
53 set_include_path($newpath);
56 $newpath = generate_next_path();
57 set_include_path($newpath);
60 teardown_include_path();
61 restore_include_path();