1--TEST-- 2Test function getservbyname() by substituting argument 1 with array values. 3--FILE-- 4<?php 5 6 7echo "*** Test substituting argument 1 with array values ***\n"; 8 9$protocol = "tcp"; 10 11 12$index_array = array(1, 2, 3); 13$assoc_array = array(1 => 'one', 2 => 'two'); 14 15$variation_array = array( 16 'empty array' => array(), 17 'int indexed array' => $index_array, 18 'associative array' => $assoc_array, 19 'nested arrays' => array('foo', $index_array, $assoc_array), 20 ); 21 22 23foreach ( $variation_array as $var ) { 24 var_dump(getservbyname( $var , $protocol ) ); 25} 26?> 27--EXPECTF-- 28*** Test substituting argument 1 with array values *** 29 30Warning: getservbyname() expects parameter 1 to be string, array given in %s on line %d 31NULL 32 33Warning: getservbyname() expects parameter 1 to be string, array given in %s on line %d 34NULL 35 36Warning: getservbyname() expects parameter 1 to be string, array given in %s on line %d 37NULL 38 39Warning: getservbyname() expects parameter 1 to be string, array given in %s on line %d 40NULL 41