php-src/ext/standard/tests/general_functions/getservbyname_basic.phpt
2012-10-10 10:27:49 +08:00

32 lines
555 B
PHP

--TEST--
Test function getservbyname()
--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)