- New parameter parsing API

This commit is contained in:
Felipe Pena 2008-08-12 19:38:05 +00:00
parent a5f867f3d5
commit cbad1c9e7c
11 changed files with 217 additions and 223 deletions

View File

@ -1007,14 +1007,14 @@ PHP_NAMED_FUNCTION(php_if_fopen)
Close an open file pointer */ Close an open file pointer */
PHPAPI PHP_FUNCTION(fclose) PHPAPI PHP_FUNCTION(fclose)
{ {
zval **arg1; zval *arg1;
php_stream *stream; php_stream *stream;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
WRONG_PARAM_COUNT; return;
} }
PHP_STREAM_TO_ZVAL(stream, arg1); PHP_STREAM_TO_ZVAL(stream, &arg1);
if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) { if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a valid stream resource", stream->rsrc_id); php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a valid stream resource", stream->rsrc_id);
@ -1081,14 +1081,14 @@ PHP_FUNCTION(popen)
Close a file pointer opened by popen() */ Close a file pointer opened by popen() */
PHP_FUNCTION(pclose) PHP_FUNCTION(pclose)
{ {
zval **arg1; zval *arg1;
php_stream *stream; php_stream *stream;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
WRONG_PARAM_COUNT; return;
} }
PHP_STREAM_TO_ZVAL(stream, arg1); PHP_STREAM_TO_ZVAL(stream, &arg1);
zend_list_delete(stream->rsrc_id); zend_list_delete(stream->rsrc_id);
RETURN_LONG(FG(pclose_ret)); RETURN_LONG(FG(pclose_ret));
@ -1099,14 +1099,14 @@ PHP_FUNCTION(pclose)
Test for end-of-file on a file pointer */ Test for end-of-file on a file pointer */
PHPAPI PHP_FUNCTION(feof) PHPAPI PHP_FUNCTION(feof)
{ {
zval **arg1; zval *arg1;
php_stream *stream; php_stream *stream;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
WRONG_PARAM_COUNT; return;
} }
PHP_STREAM_TO_ZVAL(stream, arg1); PHP_STREAM_TO_ZVAL(stream, &arg1);
if (php_stream_eof(stream)) { if (php_stream_eof(stream)) {
RETURN_TRUE; RETURN_TRUE;
@ -1171,14 +1171,14 @@ PHPAPI PHP_FUNCTION(fgets)
Get a character from file pointer */ Get a character from file pointer */
PHPAPI PHP_FUNCTION(fgetc) PHPAPI PHP_FUNCTION(fgetc)
{ {
zval **arg1; zval *arg1;
php_stream *stream; php_stream *stream;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
WRONG_PARAM_COUNT; return;
} }
PHP_STREAM_TO_ZVAL(stream, arg1); PHP_STREAM_TO_ZVAL(stream, &arg1);
if (stream->readbuf_type == IS_UNICODE) { if (stream->readbuf_type == IS_UNICODE) {
int buflen = 1; int buflen = 1;
@ -1285,30 +1285,19 @@ PHPAPI PHP_FUNCTION(fgetss)
Implements a mostly ANSI compatible fscanf() */ Implements a mostly ANSI compatible fscanf() */
PHP_FUNCTION(fscanf) PHP_FUNCTION(fscanf)
{ {
int result; int type, result, argc = 0;
zval **file_handle, **format_string; zval ***args = NULL;
int type; zval **format;
zval *file_handle;
char *buf; char *buf;
UChar *u_buf; UChar *u_buf;
void *what; void *what;
zval ***args; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ*", &file_handle, &format, &args, &argc) == FAILURE) {
int argCount; return;
argCount = ZEND_NUM_ARGS();
if (argCount < 2) {
WRONG_PARAM_COUNT;
}
args = (zval ***)safe_emalloc(argCount, sizeof(zval **), 0);
if (zend_get_parameters_array_ex(argCount, args) == FAILURE) {
efree( args );
WRONG_PARAM_COUNT;
} }
file_handle = args[0]; what = zend_fetch_resource(&file_handle TSRMLS_CC, -1, "File-Handle", &type, 2, php_file_le_stream(), php_file_le_pstream());
format_string = args[1];
what = zend_fetch_resource(file_handle TSRMLS_CC, -1, "File-Handle", &type, 2, php_file_le_stream(), php_file_le_pstream());
/* /*
* we can't do a ZEND_VERIFY_RESOURCE(what), otherwise we end up * we can't do a ZEND_VERIFY_RESOURCE(what), otherwise we end up
@ -1316,38 +1305,45 @@ PHP_FUNCTION(fscanf)
* if the code behind ZEND_VERIFY_RESOURCE changed. - cc * if the code behind ZEND_VERIFY_RESOURCE changed. - cc
*/ */
if (!what) { if (!what) {
efree(args); if (args) {
efree(args);
}
RETURN_FALSE; RETURN_FALSE;
} }
if (((php_stream *)what)->readbuf_type == IS_UNICODE) { if (((php_stream *)what)->readbuf_type == IS_UNICODE) {
u_buf = php_stream_u_get_line((php_stream *) what, NULL_ZSTR, 0, 0, NULL); u_buf = php_stream_u_get_line((php_stream *) what, NULL_ZSTR, 0, 0, NULL);
if (u_buf == NULL) { if (u_buf == NULL) {
efree(args); if (args) {
efree(args);
}
RETURN_FALSE; RETURN_FALSE;
} }
convert_to_unicode_ex(format_string); convert_to_unicode_ex(format);
result = php_u_sscanf_internal(u_buf, Z_USTRVAL_PP(format_string), argCount, args, 2, &return_value TSRMLS_CC); result = php_u_sscanf_internal(u_buf, Z_USTRVAL_PP(format), argc, args, 0, &return_value TSRMLS_CC);
efree(u_buf); efree(u_buf);
} else { } else {
buf = php_stream_get_line((php_stream *) what, NULL_ZSTR, 0, NULL); buf = php_stream_get_line((php_stream *) what, NULL_ZSTR, 0, NULL);
if (buf == NULL) { if (buf == NULL) {
efree(args); if (args) {
efree(args);
}
RETURN_FALSE; RETURN_FALSE;
} }
convert_to_string_ex(format_string); convert_to_string_ex(format);
result = php_sscanf_internal(buf, Z_STRVAL_PP(format_string), argCount, args, 2, &return_value TSRMLS_CC); result = php_sscanf_internal(buf, Z_STRVAL_PP(format), argc, args, 0, &return_value TSRMLS_CC);
efree(buf); efree(buf);
} }
efree(args); if (args) {
efree(args);
}
if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { if (SCAN_ERROR_WRONG_PARAM_COUNT == result) {
WRONG_PARAM_COUNT; WRONG_PARAM_COUNT;
} }
} }
/* }}} */ /* }}} */
@ -1404,15 +1400,15 @@ PHPAPI PHP_FUNCTION(fwrite)
Flushes output */ Flushes output */
PHPAPI PHP_FUNCTION(fflush) PHPAPI PHP_FUNCTION(fflush)
{ {
zval **arg1; zval *arg1;
int ret; int ret;
php_stream *stream; php_stream *stream;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
WRONG_PARAM_COUNT; return;
} }
PHP_STREAM_TO_ZVAL(stream, arg1); PHP_STREAM_TO_ZVAL(stream, &arg1);
ret = php_stream_flush(stream); ret = php_stream_flush(stream);
if (ret) { if (ret) {
@ -1426,14 +1422,14 @@ PHPAPI PHP_FUNCTION(fflush)
Rewind the position of a file pointer */ Rewind the position of a file pointer */
PHPAPI PHP_FUNCTION(rewind) PHPAPI PHP_FUNCTION(rewind)
{ {
zval **arg1; zval *arg1;
php_stream *stream; php_stream *stream;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
WRONG_PARAM_COUNT; return;
} }
PHP_STREAM_TO_ZVAL(stream, arg1); PHP_STREAM_TO_ZVAL(stream, &arg1);
if (-1 == php_stream_rewind(stream)) { if (-1 == php_stream_rewind(stream)) {
RETURN_FALSE; RETURN_FALSE;
@ -1446,15 +1442,15 @@ PHPAPI PHP_FUNCTION(rewind)
Get file pointer's read/write position */ Get file pointer's read/write position */
PHPAPI PHP_FUNCTION(ftell) PHPAPI PHP_FUNCTION(ftell)
{ {
zval **arg1; zval *arg1;
long ret; long ret;
php_stream *stream; php_stream *stream;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
WRONG_PARAM_COUNT; return;
} }
PHP_STREAM_TO_ZVAL(stream, arg1); PHP_STREAM_TO_ZVAL(stream, &arg1);
ret = php_stream_tell(stream); ret = php_stream_tell(stream);
if (ret == -1) { if (ret == -1) {
@ -1468,23 +1464,22 @@ PHPAPI PHP_FUNCTION(ftell)
Seek on a file pointer */ Seek on a file pointer */
PHPAPI PHP_FUNCTION(fseek) PHPAPI PHP_FUNCTION(fseek)
{ {
zval **arg1, **arg2, **arg3; zval *arg1;
int argcount = ZEND_NUM_ARGS(), whence = SEEK_SET; long arg2, arg3;
int whence = SEEK_SET, argcount = ZEND_NUM_ARGS();
php_stream *stream; php_stream *stream;
if (argcount < 2 || argcount > 3 || zend_get_parameters_ex(argcount, &arg1, &arg2, &arg3) == FAILURE) { if (zend_parse_parameters(argcount TSRMLS_CC, "rl|l", &arg1, &arg2, &arg3) == FAILURE) {
WRONG_PARAM_COUNT; return;
} }
PHP_STREAM_TO_ZVAL(stream, arg1); PHP_STREAM_TO_ZVAL(stream, &arg1);
convert_to_long_ex(arg2);
if (argcount > 2) { if (argcount > 2) {
convert_to_long_ex(arg3); whence = arg3;
whence = Z_LVAL_PP(arg3);
} }
RETURN_LONG(php_stream_seek(stream, Z_LVAL_PP(arg2), whence)); RETURN_LONG(php_stream_seek(stream, arg2, whence));
} }
/* }}} */ /* }}} */
@ -1603,7 +1598,7 @@ PHP_FUNCTION(readfile)
Return or change the umask */ Return or change the umask */
PHP_FUNCTION(umask) PHP_FUNCTION(umask)
{ {
zval **arg1; long arg1;
int oldumask; int oldumask;
int arg_count = ZEND_NUM_ARGS(); int arg_count = ZEND_NUM_ARGS();
@ -1613,14 +1608,14 @@ PHP_FUNCTION(umask)
BG(umask) = oldumask; BG(umask) = oldumask;
} }
if (zend_parse_parameters(arg_count TSRMLS_CC, "|l", &arg1) == FAILURE) {
return;
}
if (arg_count == 0) { if (arg_count == 0) {
umask(oldumask); umask(oldumask);
} else { } else {
if (arg_count > 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { umask(arg1);
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg1);
umask(Z_LVAL_PP(arg1));
} }
RETURN_LONG(oldumask); RETURN_LONG(oldumask);
@ -1631,15 +1626,15 @@ PHP_FUNCTION(umask)
Output all remaining data from a file pointer */ Output all remaining data from a file pointer */
PHPAPI PHP_FUNCTION(fpassthru) PHPAPI PHP_FUNCTION(fpassthru)
{ {
zval **arg1; zval *arg1;
int size; int size;
php_stream *stream; php_stream *stream;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
WRONG_PARAM_COUNT; return;
} }
PHP_STREAM_TO_ZVAL(stream, arg1); PHP_STREAM_TO_ZVAL(stream, &arg1);
size = php_stream_passthru(stream); size = php_stream_passthru(stream);
RETURN_LONG(size); RETURN_LONG(size);
@ -1728,23 +1723,22 @@ PHP_FUNCTION(unlink)
Truncate file to 'size' length */ Truncate file to 'size' length */
PHP_NAMED_FUNCTION(php_if_ftruncate) PHP_NAMED_FUNCTION(php_if_ftruncate)
{ {
zval **fp , **size; zval *fp;
long size;
php_stream *stream; php_stream *stream;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fp, &size) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &fp, &size) == FAILURE) {
WRONG_PARAM_COUNT; return;
} }
PHP_STREAM_TO_ZVAL(stream, fp); PHP_STREAM_TO_ZVAL(stream, &fp);
convert_to_long_ex(size);
if (!php_stream_truncate_supported(stream)) { if (!php_stream_truncate_supported(stream)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate this stream!"); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate this stream!");
RETURN_FALSE; RETURN_FALSE;
} }
RETURN_BOOL(0 == php_stream_truncate_set_size(stream, Z_LVAL_PP(size))); RETURN_BOOL(0 == php_stream_truncate_set_size(stream, size));
} }
/* }}} */ /* }}} */
@ -1752,7 +1746,7 @@ PHP_NAMED_FUNCTION(php_if_ftruncate)
Stat() on a filehandle */ Stat() on a filehandle */
PHP_NAMED_FUNCTION(php_if_fstat) PHP_NAMED_FUNCTION(php_if_fstat)
{ {
zval **fp; zval *fp;
zval *stat_dev, *stat_ino, *stat_mode, *stat_nlink, *stat_uid, *stat_gid, *stat_rdev, zval *stat_dev, *stat_ino, *stat_mode, *stat_nlink, *stat_uid, *stat_gid, *stat_rdev,
*stat_size, *stat_atime, *stat_mtime, *stat_ctime, *stat_blksize, *stat_blocks; *stat_size, *stat_atime, *stat_mtime, *stat_ctime, *stat_blksize, *stat_blocks;
php_stream *stream; php_stream *stream;
@ -1762,11 +1756,11 @@ PHP_NAMED_FUNCTION(php_if_fstat)
"size", "atime", "mtime", "ctime", "blksize", "blocks" "size", "atime", "mtime", "ctime", "blksize", "blocks"
}; };
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fp) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &fp) == FAILURE) {
WRONG_PARAM_COUNT; return;
} }
PHP_STREAM_TO_ZVAL(stream, fp); PHP_STREAM_TO_ZVAL(stream, &fp);
if (php_stream_stat(stream, &stat_ssb)) { if (php_stream_stat(stream, &stat_ssb)) {
RETURN_FALSE; RETURN_FALSE;

View File

@ -77,28 +77,28 @@ bool(false)
Warning: fclose(): 5 is not a valid stream resource in %s on line %d Warning: fclose(): 5 is not a valid stream resource in %s on line %d
bool(false) bool(false)
Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d Warning: fclose() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL
Warning: Wrong parameter count for fclose() in %s on line %d Warning: fclose() expects exactly 1 parameter, 0 given in %s on line %d
NULL NULL
Warning: feof(): 5 is not a valid stream resource in %s on line %d Warning: feof(): 5 is not a valid stream resource in %s on line %d
bool(false) bool(false)
Warning: feof(): supplied argument is not a valid stream resource in %s on line %d Warning: feof() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL
Warning: Wrong parameter count for feof() in %s on line %d Warning: feof() expects exactly 1 parameter, 0 given in %s on line %d
NULL NULL
Warning: fopen() expects at most 4 parameters, 5 given in %s on line %d Warning: fopen() expects at most 4 parameters, 5 given in %s on line %d
bool(false) bool(false)
Warning: Wrong parameter count for fclose() in %s on line %d Warning: fclose() expects exactly 1 parameter, 2 given in %s on line %d
NULL NULL
Warning: Wrong parameter count for feof() in %s on line %d Warning: feof() expects exactly 1 parameter, 2 given in %s on line %d
NULL NULL
-- Testing fopen(), fclose() & feof() with invalid arguments -- -- Testing fopen(), fclose() & feof() with invalid arguments --
-- Iteration 1 -- -- Iteration 1 --
@ -106,41 +106,41 @@ NULL
Warning: fopen(string): failed to open stream: No such file or directory in %s on line %d Warning: fopen(string): failed to open stream: No such file or directory in %s on line %d
bool(false) bool(false)
Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d Warning: fclose() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL
Warning: feof(): supplied argument is not a valid stream resource in %s on line %d Warning: feof() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL
-- Iteration 2 -- -- Iteration 2 --
Warning: fopen(10): failed to open stream: No such file or directory in %s on line %d Warning: fopen(10): failed to open stream: No such file or directory in %s on line %d
bool(false) bool(false)
Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d Warning: fclose() expects parameter 1 to be resource, integer given in %s on line %d
bool(false) NULL
Warning: feof(): supplied argument is not a valid stream resource in %s on line %d Warning: feof() expects parameter 1 to be resource, integer given in %s on line %d
bool(false) NULL
-- Iteration 3 -- -- Iteration 3 --
Warning: fopen(10.5): failed to open stream: No such file or directory in %s on line %d Warning: fopen(10.5): failed to open stream: No such file or directory in %s on line %d
bool(false) bool(false)
Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d Warning: fclose() expects parameter 1 to be resource, double given in %s on line %d
bool(false) NULL
Warning: feof(): supplied argument is not a valid stream resource in %s on line %d Warning: feof() expects parameter 1 to be resource, double given in %s on line %d
bool(false) NULL
-- Iteration 4 -- -- Iteration 4 --
Warning: fopen(1): failed to open stream: No such file or directory in %s on line %d Warning: fopen(1): failed to open stream: No such file or directory in %s on line %d
bool(false) bool(false)
Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d Warning: fclose() expects parameter 1 to be resource, boolean given in %s on line %d
bool(false) NULL
Warning: feof(): supplied argument is not a valid stream resource in %s on line %d Warning: feof() expects parameter 1 to be resource, boolean given in %s on line %d
bool(false) NULL
-- Iteration 5 -- -- Iteration 5 --
Notice: Array to string conversion in %s on line %d Notice: Array to string conversion in %s on line %d
@ -148,24 +148,24 @@ Notice: Array to string conversion in %s on line %d
Warning: fopen(Array): failed to open stream: No such file or directory in %s on line %d Warning: fopen(Array): failed to open stream: No such file or directory in %s on line %d
bool(false) bool(false)
Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d Warning: fclose() expects parameter 1 to be resource, array given in %s on line %d
bool(false) NULL
Warning: feof(): supplied argument is not a valid stream resource in %s on line %d Warning: feof() expects parameter 1 to be resource, array given in %s on line %d
bool(false) NULL
-- Iteration 6 -- -- Iteration 6 --
bool(false) bool(false)
Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d Warning: fclose() expects parameter 1 to be resource, null given in %s on line %d
bool(false) NULL
Warning: feof(): supplied argument is not a valid stream resource in %s on line %d Warning: feof() expects parameter 1 to be resource, null given in %s on line %d
bool(false) NULL
-- Iteration 7 -- -- Iteration 7 --
bool(false) bool(false)
Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d Warning: fclose() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL
Warning: feof(): supplied argument is not a valid stream resource in %s on line %d Warning: feof() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL

View File

@ -54,36 +54,36 @@ unlink("$file_path/fflush_error.tmp");
*** Testing error conditions *** *** Testing error conditions ***
-- Testing fflush(): with zero argument -- -- Testing fflush(): with zero argument --
Warning: Wrong parameter count for fflush() in %s on line %d Warning: fflush() expects exactly 1 parameter, 0 given in %s on line %d
NULL NULL
-- Testing fflush(): with more than expected number of arguments -- -- Testing fflush(): with more than expected number of arguments --
Warning: Wrong parameter count for fflush() in %s on line %d Warning: fflush() expects exactly 1 parameter, 2 given in %s on line %d
NULL NULL
-- Testing fflush(): with invalid arguments -- -- Testing fflush(): with invalid arguments --
-- Iteration 1 -- -- Iteration 1 --
Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d Warning: fflush() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL
-- Iteration 2 -- -- Iteration 2 --
Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d Warning: fflush() expects parameter 1 to be resource, integer given in %s on line %d
bool(false) NULL
-- Iteration 3 -- -- Iteration 3 --
Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d Warning: fflush() expects parameter 1 to be resource, double given in %s on line %d
bool(false) NULL
-- Iteration 4 -- -- Iteration 4 --
Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d Warning: fflush() expects parameter 1 to be resource, boolean given in %s on line %d
bool(false) NULL
-- Iteration 5 -- -- Iteration 5 --
Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d Warning: fflush() expects parameter 1 to be resource, array given in %s on line %d
bool(false) NULL
-- Iteration 6 -- -- Iteration 6 --
Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d Warning: fflush() expects parameter 1 to be resource, object given in %s on line %d
bool(false) NULL
*** Done *** *** Done ***

View File

@ -39,35 +39,35 @@ echo "Done\n";
*** Testing error conditions *** *** Testing error conditions ***
-- Testing fgetc() with zero argument -- -- Testing fgetc() with zero argument --
Warning: Wrong parameter count for fgetc() in %s on line %d Warning: fgetc() expects exactly 1 parameter, 0 given in %s on line %d
NULL NULL
-- Testing fgetc() with more than expected number of arguments -- -- Testing fgetc() with more than expected number of arguments --
Warning: Wrong parameter count for fgetc() in %s on line %d Warning: fgetc() expects exactly 1 parameter, 2 given in %s on line %d
NULL NULL
-- Testing fgetc() with invalid arguments -- -- Testing fgetc() with invalid arguments --
-- Iteration 1 -- -- Iteration 1 --
Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d Warning: fgetc() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL
-- Iteration 2 -- -- Iteration 2 --
Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d Warning: fgetc() expects parameter 1 to be resource, integer given in %s on line %d
bool(false) NULL
-- Iteration 3 -- -- Iteration 3 --
Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d Warning: fgetc() expects parameter 1 to be resource, double given in %s on line %d
bool(false) NULL
-- Iteration 4 -- -- Iteration 4 --
Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d Warning: fgetc() expects parameter 1 to be resource, boolean given in %s on line %d
bool(false) NULL
-- Iteration 5 -- -- Iteration 5 --
Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d Warning: fgetc() expects parameter 1 to be resource, array given in %s on line %d
bool(false) NULL
-- Iteration 6 -- -- Iteration 6 --
Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d Warning: fgetc() expects parameter 1 to be resource, object given in %s on line %d
bool(false) NULL
Done Done

View File

@ -105,6 +105,6 @@ bool(false)
Warning: fgetss() expects parameter 1 to be resource, null given in %s on line %d Warning: fgetss() expects parameter 1 to be resource, null given in %s on line %d
NULL NULL
Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d Warning: fclose() expects parameter 1 to be resource, null given in %s on line %d
bool(false) NULL
Done Done

View File

@ -56,44 +56,44 @@ echo "Done\n";
*** Testing fseek() : error conditions *** *** Testing fseek() : error conditions ***
-- Testing fseek() with zero argument -- -- Testing fseek() with zero argument --
Warning: Wrong parameter count for fseek() in %s on line %d Warning: fseek() expects at least 2 parameters, 0 given in %s on line %d
NULL NULL
-- Testing fseek() with unexpected number of arguments -- -- Testing fseek() with unexpected number of arguments --
Warning: Wrong parameter count for fseek() in %s on line %d Warning: fseek() expects at least 2 parameters, 1 given in %s on line %d
NULL NULL
Warning: Wrong parameter count for fseek() in %s on line %d Warning: fseek() expects at most 3 parameters, 4 given in %s on line %d
NULL NULL
-- Testing fseek() with invalid arguments -- -- Testing fseek() with invalid arguments --
-- Iteration 1 -- -- Iteration 1 --
Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d Warning: fseek() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL
-- Iteration 2 -- -- Iteration 2 --
Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d Warning: fseek() expects parameter 1 to be resource, integer given in %s on line %d
bool(false) NULL
-- Iteration 3 -- -- Iteration 3 --
Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d Warning: fseek() expects parameter 1 to be resource, double given in %s on line %d
bool(false) NULL
-- Iteration 4 -- -- Iteration 4 --
Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d Warning: fseek() expects parameter 1 to be resource, boolean given in %s on line %d
bool(false) NULL
-- Iteration 5 -- -- Iteration 5 --
Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d Warning: fseek() expects parameter 1 to be resource, array given in %s on line %d
bool(false) NULL
-- Iteration 6 -- -- Iteration 6 --
Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d Warning: fseek() expects parameter 1 to be resource, object given in %s on line %d
bool(false) NULL
-- Testing fseek() with closed/unset file handle -- -- Testing fseek() with closed/unset file handle --
Warning: fseek(): 5 is not a valid stream resource in %s on line %d Warning: fseek(): 5 is not a valid stream resource in %s on line %d
bool(false) bool(false)
Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d Warning: fseek() expects parameter 1 to be resource, null given in %s on line %d
bool(false) NULL
Done Done

View File

@ -55,41 +55,41 @@ echo "Done\n";
*** Testing ftell() : error conditions *** *** Testing ftell() : error conditions ***
-- Testing ftell() with zero argument -- -- Testing ftell() with zero argument --
Warning: Wrong parameter count for ftell() in %s on line %d Warning: ftell() expects exactly 1 parameter, 0 given in %s on line %d
NULL NULL
-- Testing ftell() with more than expected number of arguments -- -- Testing ftell() with more than expected number of arguments --
Warning: Wrong parameter count for ftell() in %s on line %d Warning: ftell() expects exactly 1 parameter, 2 given in %s on line %d
NULL NULL
-- Testing ftell() with invalid arguments -- -- Testing ftell() with invalid arguments --
-- Iteration 1 -- -- Iteration 1 --
Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d Warning: ftell() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL
-- Iteration 2 -- -- Iteration 2 --
Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d Warning: ftell() expects parameter 1 to be resource, integer given in %s on line %d
bool(false) NULL
-- Iteration 3 -- -- Iteration 3 --
Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d Warning: ftell() expects parameter 1 to be resource, double given in %s on line %d
bool(false) NULL
-- Iteration 4 -- -- Iteration 4 --
Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d Warning: ftell() expects parameter 1 to be resource, boolean given in %s on line %d
bool(false) NULL
-- Iteration 5 -- -- Iteration 5 --
Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d Warning: ftell() expects parameter 1 to be resource, array given in %s on line %d
bool(false) NULL
-- Iteration 6 -- -- Iteration 6 --
Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d Warning: ftell() expects parameter 1 to be resource, object given in %s on line %d
bool(false) NULL
-- Testing ftell with closed/unset file handle -- -- Testing ftell with closed/unset file handle --
Warning: ftell(): 5 is not a valid stream resource in %s on line %d Warning: ftell(): 5 is not a valid stream resource in %s on line %d
bool(false) bool(false)
Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d Warning: ftell() expects parameter 1 to be resource, null given in %s on line %d
bool(false) NULL
Done Done

View File

@ -55,41 +55,41 @@ echo "Done\n";
*** Testing rewind() : error conditions *** *** Testing rewind() : error conditions ***
-- Testing rewind() with zero argument -- -- Testing rewind() with zero argument --
Warning: Wrong parameter count for rewind() in %s on line %d Warning: rewind() expects exactly 1 parameter, 0 given in %s on line %d
NULL NULL
-- Testing rewind() with more than expected number of arguments -- -- Testing rewind() with more than expected number of arguments --
Warning: Wrong parameter count for rewind() in %s on line %d Warning: rewind() expects exactly 1 parameter, 2 given in %s on line %d
NULL NULL
-- Testing rewind() with invalid arguments -- -- Testing rewind() with invalid arguments --
-- Iteration 1 -- -- Iteration 1 --
Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d Warning: rewind() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL
-- Iteration 2 -- -- Iteration 2 --
Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d Warning: rewind() expects parameter 1 to be resource, integer given in %s on line %d
bool(false) NULL
-- Iteration 3 -- -- Iteration 3 --
Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d Warning: rewind() expects parameter 1 to be resource, double given in %s on line %d
bool(false) NULL
-- Iteration 4 -- -- Iteration 4 --
Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d Warning: rewind() expects parameter 1 to be resource, boolean given in %s on line %d
bool(false) NULL
-- Iteration 5 -- -- Iteration 5 --
Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d Warning: rewind() expects parameter 1 to be resource, array given in %s on line %d
bool(false) NULL
-- Iteration 6 -- -- Iteration 6 --
Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d Warning: rewind() expects parameter 1 to be resource, object given in %s on line %d
bool(false) NULL
-- Testing rewind() with closed/unset file handle -- -- Testing rewind() with closed/unset file handle --
Warning: rewind(): 5 is not a valid stream resource in %s on line %d Warning: rewind(): 5 is not a valid stream resource in %s on line %d
bool(false) bool(false)
Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d Warning: rewind() expects parameter 1 to be resource, null given in %s on line %d
bool(false) NULL
Done Done

View File

@ -76,49 +76,49 @@ unlink( $filename );
Initial file size = 36 Initial file size = 36
-- Testing ftruncate() with less than expected number of arguments -- -- Testing ftruncate() with less than expected number of arguments --
Warning: Wrong parameter count for ftruncate() in %s on line %d Warning: ftruncate() expects exactly 2 parameters, 0 given in %s on line %d
NULL NULL
Warning: Wrong parameter count for ftruncate() in %s on line %d Warning: ftruncate() expects exactly 2 parameters, 1 given in %s on line %d
NULL NULL
int(36) int(36)
-- Testing ftruncate() with more than expected number of arguments -- -- Testing ftruncate() with more than expected number of arguments --
Warning: Wrong parameter count for ftruncate() in %s on line %d Warning: ftruncate() expects exactly 2 parameters, 3 given in %s on line %d
NULL NULL
int(36) int(36)
-- Testing ftruncate() with invalid file pointer -- -- Testing ftruncate() with invalid file pointer --
-- Iteration 1 -- -- Iteration 1 --
Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d Warning: ftruncate() expects parameter 1 to be resource, Unicode string given in %s on line %d
bool(false) NULL
-- Iteration 2 -- -- Iteration 2 --
Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d Warning: ftruncate() expects parameter 1 to be resource, integer given in %s on line %d
bool(false) NULL
-- Iteration 3 -- -- Iteration 3 --
Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d Warning: ftruncate() expects parameter 1 to be resource, double given in %s on line %d
bool(false) NULL
-- Iteration 4 -- -- Iteration 4 --
Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d Warning: ftruncate() expects parameter 1 to be resource, boolean given in %s on line %d
bool(false) NULL
-- Iteration 5 -- -- Iteration 5 --
Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d Warning: ftruncate() expects parameter 1 to be resource, array given in %s on line %d
bool(false) NULL
-- Iteration 6 -- -- Iteration 6 --
Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d Warning: ftruncate() expects parameter 1 to be resource, object given in %s on line %d
bool(false) NULL
-- Testing ftruncate() with closed/unset file handle -- -- Testing ftruncate() with closed/unset file handle --
Warning: ftruncate(): 5 is not a valid stream resource in %s on line %d Warning: ftruncate(): 5 is not a valid stream resource in %s on line %d
bool(false) bool(false)
int(36) int(36)
Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d Warning: ftruncate() expects parameter 1 to be resource, null given in %s on line %d
bool(false) NULL
int(36) int(36)
Done Done

View File

@ -41,16 +41,16 @@ NULL
Warning: popen() expects exactly 2 parameters, 1 given in %s on line %d Warning: popen() expects exactly 2 parameters, 1 given in %s on line %d
NULL NULL
Warning: popen(abc.txt,rw): %s on line %d Warning: popen(abc.txt,rw): Invalid argument in %s on line %d
bool(false) bool(false)
Warning: Wrong parameter count for pclose() in %s on line %d Warning: pclose() expects exactly 1 parameter, 0 given in %s on line %d
NULL NULL
Warning: Wrong parameter count for pclose() in %s on line %d Warning: pclose() expects exactly 1 parameter, 2 given in %s on line %d
NULL NULL
Warning: pclose(): supplied argument is not a valid stream resource in %s on line %d Warning: pclose() expects parameter 1 to be resource, integer given in %s on line %d
bool(false) NULL
--- Done --- --- Done ---

View File

@ -21,6 +21,6 @@ echo "Done\n";
--EXPECTF-- --EXPECTF--
*** Testing umask() : error conditions *** *** Testing umask() : error conditions ***
Warning: Wrong parameter count for umask() in %s on line %d Warning: umask() expects at most 1 parameter, 2 given in %s on line %d
NULL NULL
Done Done