1--TEST--
2Test if socket_create_listen() returns false, when it cannot bind to the port.
3--EXTENSIONS--
4sockets
5--SKIPIF--
6<?php
7
8$filename = __FILE__ . '.root_check.tmp';
9$fp = fopen($filename, 'w');
10fclose($fp);
11if (fileowner($filename) == 0) {
12    unlink($filename);
13    die('SKIP Test cannot be run as root.');
14}
15unlink($filename);
16if (@socket_create_listen(80)) {
17    die('SKIP Test cannot be run in environment that will allow binding to port 80 (azure)');
18}
19?>
20--FILE--
21<?php
22$sock = socket_create_listen(80);
23?>
24--EXPECTF--
25Warning: socket_create_listen(): unable to bind to given address [13]: Permission denied in %s on line %d
26--CREDITS--
27Till Klampaeckel, till@php.net
28PHP Testfest Berlin 2009-05-09
29