1--TEST--
2Test function getservbyport() by calling it more than or less than its expected arguments
3--DESCRIPTION--
4Test function passing invalid port number and invalid protocol name
5--CREDITS--
6Italian PHP TestFest 2009 Cesena 19-20-21 june
7Fabio Fabbrucci (fabbrucci@grupporetina.com)
8Michele Orselli (mo@ideato.it)
9Simone Gentili (sensorario@gmail.com)
10--FILE--
11<?php
12	var_dump(getservbyport( -1, "tcp" ));
13	var_dump(getservbyport( 80, "ppp" ));
14	var_dump(getservbyport( null, null));
15	var_dump(getservbyport( array(), array()));
16	var_dump(getservbyport( array(80), array("tcp")));
17	var_dump(getservbyport( array(2, 3), array("one"=>1, "two"=>2)));
18	var_dump(getservbyport( 2, 2));
19	var_dump(getservbyport( "80", "tcp"));
20	var_dump(getservbyport( new stdClass(), new stdClass()));
21
22?>
23--EXPECTF--
24bool(false)
25bool(false)
26bool(false)
27
28Warning: getservbyport() expects parameter 1 to be long, array given in %s on line %d
29NULL
30
31Warning: getservbyport() expects parameter 1 to be long, array given in %s on line %d
32NULL
33
34Warning: getservbyport() expects parameter 1 to be long, array given in %s on line %d
35NULL
36bool(false)
37string(%d) "%s"
38
39Warning: getservbyport() expects parameter 1 to be long, object given in %s on line %d
40NULL
41