mirror of
https://github.com/php/php-src.git
synced 2024-10-04 16:26:13 +00:00
32 lines
615 B
Plaintext
32 lines
615 B
Plaintext
|
--TEST--
|
||
|
Test function getservbyport() by calling it more than or less than its expected arguments
|
||
|
--CREDITS--
|
||
|
Italian PHP TestFest 2009 Cesena 19-20-21 june
|
||
|
Fabio Fabbrucci (fabbrucci@grupporetina.com)
|
||
|
Michele Orselli (mo@ideato.it)
|
||
|
Simone Gentili (sensorario@gmail.com)
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
$services = array('http', 'ftp', 'ssh', 'telnet', 'imap', 'smtp', 'nicname', 'gopher', 'finger', 'pop3', 'www');
|
||
|
|
||
|
foreach ($services as $service) {
|
||
|
$port = getservbyname($service, 'tcp');
|
||
|
var_dump($port);
|
||
|
}
|
||
|
|
||
|
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
int(%d)
|
||
|
int(%d)
|
||
|
int(%d)
|
||
|
int(%d)
|
||
|
int(%d)
|
||
|
int(%d)
|
||
|
int(%d)
|
||
|
int(%d)
|
||
|
int(%d)
|
||
|
int(%d)
|
||
|
int(%d)
|