1--TEST--
2Test fopen() function : variation: use include path and stream context relative/absolute file
3--CREDITS--
4Dave Kelsey <d_kelsey@uk.ibm.com>
5--FILE--
6<?php
7echo "*** Testing fopen() : variation ***\n";
8$absfile = __FILE__.'.tmp';
9$relfile = "fopen_variation6.tmp";
10
11$h = fopen($absfile, "w");
12fwrite($h, "This is an absolute file");
13fclose($h);
14
15$h = fopen($relfile, "w");
16fwrite($h, "This is a relative file");
17fclose($h);
18
19$ctx = stream_context_create();
20$h = fopen($absfile, "r", true, $ctx);
21fpassthru($h);
22fclose($h);
23echo "\n";
24
25$h = fopen($relfile, "r", true, $ctx);
26fpassthru($h);
27fclose($h);
28echo "\n";
29
30unlink($absfile);
31unlink($relfile);
32?>
33--EXPECT--
34*** Testing fopen() : variation ***
35This is an absolute file
36This is a relative file
37