1--TEST--
2Test if socket_create_listen() returns false, when it cannot bind to the port.
3--SKIPIF--
4<?php
5if (!extension_loaded('sockets')) {
6    die('SKIP The sockets extension is not loaded.');
7}
8$filename = dirname(__FILE__) . '/006_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}
15--FILE--
16<?php
17$sock = socket_create_listen(80);
18--EXPECTF--
19Warning: socket_create_listen(): unable to bind to given address [13]: Permission denied in %s on line %d
20--CLEAN--
21<?php
22unlink(dirname(__FILE__) . '/006_root_check.tmp');
23--CREDITS--
24Till Klampaeckel, till@php.net
25PHP Testfest Berlin 2009-05-09
26