Annotation of embedaddon/php/ext/standard/tests/strings/strlen_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test strlen() function : error conditions
! 3: --FILE--
! 4: <?php
! 5:
! 6: /* Prototype : int strlen ( string $string )
! 7: * Description: Get string length
! 8: * Source code: ext/standard/string.c
! 9: */
! 10:
! 11: echo "*** Testing strlen() : unexpected number of arguments ***";
! 12:
! 13:
! 14: echo "\n-- Testing strlen() function with no arguments --\n";
! 15: var_dump( strlen() );
! 16:
! 17: echo "\n-- Testing strlen() function with more than expected no. of arguments --\n";
! 18: $extra_arg = 10;
! 19: var_dump( strlen("abc def", $extra_arg) );
! 20: ?>
! 21: ===DONE===
! 22: --EXPECTF--
! 23: *** Testing strlen() : unexpected number of arguments ***
! 24: -- Testing strlen() function with no arguments --
! 25:
! 26: Warning: strlen() expects exactly 1 parameter, 0 given in %s on line %d
! 27: NULL
! 28:
! 29: -- Testing strlen() function with more than expected no. of arguments --
! 30:
! 31: Warning: strlen() expects exactly 1 parameter, 2 given in %s on line %d
! 32: NULL
! 33: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>