1--TEST--
2stream_supports_lock
3--INI--
4allow_url_fopen=1
5--FILE--
6<?php
7$fp = fopen(__FILE__, "r");
8var_dump($fp);
9var_dump(stream_supports_lock($fp));
10fclose($fp);
11
12$fp = fopen("file://" . __FILE__, "r");
13var_dump($fp);
14var_dump(stream_supports_lock($fp));
15fclose($fp);
16
17$fp = fopen("php://memory", "r");
18var_dump($fp);
19var_dump(stream_supports_lock($fp));
20fclose($fp);
21
22$fp = fopen('data://text/plain,foobar', 'r');
23var_dump($fp);
24var_dump(stream_supports_lock($fp));
25fclose($fp);
26
27$sock = stream_context_create();
28var_dump($sock);
29var_dump(stream_supports_lock($sock));
30
31echo "Done\n";
32?>
33--EXPECTF--
34resource(%d) of type (stream)
35bool(true)
36resource(%d) of type (stream)
37bool(true)
38resource(%d) of type (stream)
39bool(false)
40resource(%d) of type (stream)
41bool(false)
42resource(%d) of type (stream-context)
43
44Warning: stream_supports_lock(): supplied resource is not a valid stream resource in %s on line %d
45bool(false)
46Done
47