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--SKIPIF-- 11<?php 12if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){ 13 if (!file_exists("/etc/services")) die("skip reason: missing /etc/services"); 14} 15if (getenv('SKIP_MSAN')) die('skip msan missing interceptor for getservbyport()'); 16?> 17--FILE-- 18<?php 19var_dump(getservbyport( -1, "tcp" )); 20var_dump(getservbyport( 80, "ppp" )); 21var_dump(getservbyport( 2, 2)); 22var_dump(getservbyport( "80", "tcp")); 23?> 24--EXPECTF-- 25bool(false) 26bool(false) 27bool(false) 28string(%d) "%s" 29