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);
29try {
30    var_dump(stream_supports_lock($sock));
31} catch (TypeError $e) {
32    echo $e->getMessage(), "\n";
33}
34
35echo "Done\n";
36?>
37--EXPECTF--
38resource(%d) of type (stream)
39bool(true)
40resource(%d) of type (stream)
41bool(true)
42resource(%d) of type (stream)
43bool(false)
44resource(%d) of type (stream)
45bool(false)
46resource(%d) of type (stream-context)
47stream_supports_lock(): supplied resource is not a valid stream resource
48Done
49