Annotation of embedaddon/php/ext/standard/tests/general_functions/getservbyname_variation8.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test function getservbyname() by substituting argument 2 with array values.
! 3: --FILE--
! 4: <?php
! 5:
! 6:
! 7: echo "*** Test substituting argument 2 with array values ***\n";
! 8:
! 9: $service = "www";
! 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:
! 23: foreach ( $variation_array as $var ) {
! 24: var_dump(getservbyname( $service, $var ) );
! 25: }
! 26: ?>
! 27: --EXPECTF--
! 28: *** Test substituting argument 2 with array values ***
! 29:
! 30: Warning: getservbyname() expects parameter 2 to be string, array given in %s on line %d
! 31: NULL
! 32:
! 33: Warning: getservbyname() expects parameter 2 to be string, array given in %s on line %d
! 34: NULL
! 35:
! 36: Warning: getservbyname() expects parameter 2 to be string, array given in %s on line %d
! 37: NULL
! 38:
! 39: Warning: getservbyname() expects parameter 2 to be string, array given in %s on line %d
! 40: NULL
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>