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--FILE--
20<?php
21$sock = socket_create_listen(80);
22?>
23--EXPECTF--
24Warning: socket_create_listen(): unable to bind to given address [13]: Permission denied in %s on line %d
25--CREDITS--
26Till Klampaeckel, till@php.net
27PHP Testfest Berlin 2009-05-09
28