From: Felipe Pena Date: Tue, 12 Aug 2008 19:38:05 +0000 (+0000) Subject: - New parameter parsing API X-Git-Tag: BEFORE_HEAD_NS_CHANGE~748 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cbad1c9e7c330f462324e7d141ffc45891c6dcc3;p=php - New parameter parsing API --- diff --git a/ext/standard/file.c b/ext/standard/file.c index c6c628bce0..9e4d992b83 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1007,14 +1007,14 @@ PHP_NAMED_FUNCTION(php_if_fopen) Close an open file pointer */ PHPAPI PHP_FUNCTION(fclose) { - zval **arg1; + zval *arg1; php_stream *stream; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + return; } - PHP_STREAM_TO_ZVAL(stream, arg1); + PHP_STREAM_TO_ZVAL(stream, &arg1); 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); @@ -1081,14 +1081,14 @@ PHP_FUNCTION(popen) Close a file pointer opened by popen() */ PHP_FUNCTION(pclose) { - zval **arg1; + zval *arg1; php_stream *stream; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + return; } - PHP_STREAM_TO_ZVAL(stream, arg1); + PHP_STREAM_TO_ZVAL(stream, &arg1); zend_list_delete(stream->rsrc_id); RETURN_LONG(FG(pclose_ret)); @@ -1099,14 +1099,14 @@ PHP_FUNCTION(pclose) Test for end-of-file on a file pointer */ PHPAPI PHP_FUNCTION(feof) { - zval **arg1; + zval *arg1; php_stream *stream; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + return; } - PHP_STREAM_TO_ZVAL(stream, arg1); + PHP_STREAM_TO_ZVAL(stream, &arg1); if (php_stream_eof(stream)) { RETURN_TRUE; @@ -1171,14 +1171,14 @@ PHPAPI PHP_FUNCTION(fgets) Get a character from file pointer */ PHPAPI PHP_FUNCTION(fgetc) { - zval **arg1; + zval *arg1; php_stream *stream; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + return; } - PHP_STREAM_TO_ZVAL(stream, arg1); + PHP_STREAM_TO_ZVAL(stream, &arg1); if (stream->readbuf_type == IS_UNICODE) { int buflen = 1; @@ -1285,30 +1285,19 @@ PHPAPI PHP_FUNCTION(fgetss) Implements a mostly ANSI compatible fscanf() */ PHP_FUNCTION(fscanf) { - int result; - zval **file_handle, **format_string; - int type; + int type, result, argc = 0; + zval ***args = NULL; + zval **format; + zval *file_handle; char *buf; UChar *u_buf; void *what; - zval ***args; - int argCount; - - 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; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ*", &file_handle, &format, &args, &argc) == FAILURE) { + return; } - file_handle = args[0]; - 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()); + 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 @@ -1316,38 +1305,45 @@ PHP_FUNCTION(fscanf) * if the code behind ZEND_VERIFY_RESOURCE changed. - cc */ if (!what) { - efree(args); + if (args) { + efree(args); + } RETURN_FALSE; } if (((php_stream *)what)->readbuf_type == IS_UNICODE) { u_buf = php_stream_u_get_line((php_stream *) what, NULL_ZSTR, 0, 0, NULL); if (u_buf == NULL) { - efree(args); + if (args) { + efree(args); + } RETURN_FALSE; } - convert_to_unicode_ex(format_string); - result = php_u_sscanf_internal(u_buf, Z_USTRVAL_PP(format_string), argCount, args, 2, &return_value TSRMLS_CC); + convert_to_unicode_ex(format); + result = php_u_sscanf_internal(u_buf, Z_USTRVAL_PP(format), argc, args, 0, &return_value TSRMLS_CC); efree(u_buf); } else { buf = php_stream_get_line((php_stream *) what, NULL_ZSTR, 0, NULL); if (buf == NULL) { - efree(args); + if (args) { + efree(args); + } RETURN_FALSE; } - convert_to_string_ex(format_string); - result = php_sscanf_internal(buf, Z_STRVAL_PP(format_string), argCount, args, 2, &return_value TSRMLS_CC); + convert_to_string_ex(format); + result = php_sscanf_internal(buf, Z_STRVAL_PP(format), argc, args, 0, &return_value TSRMLS_CC); efree(buf); } - efree(args); + if (args) { + efree(args); + } if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { WRONG_PARAM_COUNT; } - } /* }}} */ @@ -1404,15 +1400,15 @@ PHPAPI PHP_FUNCTION(fwrite) Flushes output */ PHPAPI PHP_FUNCTION(fflush) { - zval **arg1; + zval *arg1; int ret; php_stream *stream; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + return; } - PHP_STREAM_TO_ZVAL(stream, arg1); + PHP_STREAM_TO_ZVAL(stream, &arg1); ret = php_stream_flush(stream); if (ret) { @@ -1426,14 +1422,14 @@ PHPAPI PHP_FUNCTION(fflush) Rewind the position of a file pointer */ PHPAPI PHP_FUNCTION(rewind) { - zval **arg1; + zval *arg1; php_stream *stream; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + return; } - PHP_STREAM_TO_ZVAL(stream, arg1); + PHP_STREAM_TO_ZVAL(stream, &arg1); if (-1 == php_stream_rewind(stream)) { RETURN_FALSE; @@ -1446,15 +1442,15 @@ PHPAPI PHP_FUNCTION(rewind) Get file pointer's read/write position */ PHPAPI PHP_FUNCTION(ftell) { - zval **arg1; + zval *arg1; long ret; php_stream *stream; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + return; } - PHP_STREAM_TO_ZVAL(stream, arg1); + PHP_STREAM_TO_ZVAL(stream, &arg1); ret = php_stream_tell(stream); if (ret == -1) { @@ -1468,23 +1464,22 @@ PHPAPI PHP_FUNCTION(ftell) Seek on a file pointer */ PHPAPI PHP_FUNCTION(fseek) { - zval **arg1, **arg2, **arg3; - int argcount = ZEND_NUM_ARGS(), whence = SEEK_SET; + zval *arg1; + long arg2, arg3; + int whence = SEEK_SET, argcount = ZEND_NUM_ARGS(); php_stream *stream; - if (argcount < 2 || argcount > 3 || zend_get_parameters_ex(argcount, &arg1, &arg2, &arg3) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(argcount TSRMLS_CC, "rl|l", &arg1, &arg2, &arg3) == FAILURE) { + return; } - PHP_STREAM_TO_ZVAL(stream, arg1); + PHP_STREAM_TO_ZVAL(stream, &arg1); - convert_to_long_ex(arg2); if (argcount > 2) { - convert_to_long_ex(arg3); - whence = Z_LVAL_PP(arg3); + whence = 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 */ PHP_FUNCTION(umask) { - zval **arg1; + long arg1; int oldumask; int arg_count = ZEND_NUM_ARGS(); @@ -1612,15 +1607,15 @@ PHP_FUNCTION(umask) if (BG(umask) == -1) { BG(umask) = oldumask; } + + if (zend_parse_parameters(arg_count TSRMLS_CC, "|l", &arg1) == FAILURE) { + return; + } if (arg_count == 0) { umask(oldumask); } else { - if (arg_count > 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(arg1); - umask(Z_LVAL_PP(arg1)); + umask(arg1); } RETURN_LONG(oldumask); @@ -1631,15 +1626,15 @@ PHP_FUNCTION(umask) Output all remaining data from a file pointer */ PHPAPI PHP_FUNCTION(fpassthru) { - zval **arg1; + zval *arg1; int size; php_stream *stream; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { + return; } - PHP_STREAM_TO_ZVAL(stream, arg1); + PHP_STREAM_TO_ZVAL(stream, &arg1); size = php_stream_passthru(stream); RETURN_LONG(size); @@ -1728,23 +1723,22 @@ PHP_FUNCTION(unlink) Truncate file to 'size' length */ PHP_NAMED_FUNCTION(php_if_ftruncate) { - zval **fp , **size; + zval *fp; + long size; php_stream *stream; - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fp, &size) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &fp, &size) == FAILURE) { + return; } - PHP_STREAM_TO_ZVAL(stream, fp); - - convert_to_long_ex(size); + PHP_STREAM_TO_ZVAL(stream, &fp); if (!php_stream_truncate_supported(stream)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate this stream!"); 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 */ 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, *stat_size, *stat_atime, *stat_mtime, *stat_ctime, *stat_blksize, *stat_blocks; php_stream *stream; @@ -1762,11 +1756,11 @@ PHP_NAMED_FUNCTION(php_if_fstat) "size", "atime", "mtime", "ctime", "blksize", "blocks" }; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fp) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &fp) == FAILURE) { + return; } - PHP_STREAM_TO_ZVAL(stream, fp); + PHP_STREAM_TO_ZVAL(stream, &fp); if (php_stream_stat(stream, &stat_ssb)) { RETURN_FALSE; diff --git a/ext/standard/tests/file/007_error.phpt b/ext/standard/tests/file/007_error.phpt index 8b0d07af8f..ba0ebd7c13 100644 --- a/ext/standard/tests/file/007_error.phpt +++ b/ext/standard/tests/file/007_error.phpt @@ -77,28 +77,28 @@ bool(false) Warning: fclose(): 5 is not a valid stream resource in %s on line %d bool(false) -Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fclose() expects parameter 1 to be resource, Unicode string given in %s on line %d +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 Warning: feof(): 5 is not a valid stream resource in %s on line %d bool(false) -Warning: feof(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: feof() expects parameter 1 to be resource, Unicode string given in %s on line %d +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 Warning: fopen() expects at most 4 parameters, 5 given in %s on line %d 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 -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 -- Testing fopen(), fclose() & feof() with invalid arguments -- -- Iteration 1 -- @@ -106,41 +106,41 @@ NULL Warning: fopen(string): failed to open stream: No such file or directory in %s on line %d bool(false) -Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fclose() expects parameter 1 to be resource, Unicode string given in %s on line %d +NULL -Warning: feof(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: feof() expects parameter 1 to be resource, Unicode string given in %s on line %d +NULL -- Iteration 2 -- Warning: fopen(10): failed to open stream: No such file or directory in %s on line %d bool(false) -Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fclose() expects parameter 1 to be resource, integer given in %s on line %d +NULL -Warning: feof(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: feof() expects parameter 1 to be resource, integer given in %s on line %d +NULL -- Iteration 3 -- Warning: fopen(10.5): failed to open stream: No such file or directory in %s on line %d bool(false) -Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fclose() expects parameter 1 to be resource, double given in %s on line %d +NULL -Warning: feof(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: feof() expects parameter 1 to be resource, double given in %s on line %d +NULL -- Iteration 4 -- Warning: fopen(1): failed to open stream: No such file or directory in %s on line %d bool(false) -Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fclose() expects parameter 1 to be resource, boolean given in %s on line %d +NULL -Warning: feof(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: feof() expects parameter 1 to be resource, boolean given in %s on line %d +NULL -- Iteration 5 -- 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 bool(false) -Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fclose() expects parameter 1 to be resource, array given in %s on line %d +NULL -Warning: feof(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: feof() expects parameter 1 to be resource, array given in %s on line %d +NULL -- Iteration 6 -- bool(false) -Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fclose() expects parameter 1 to be resource, null given in %s on line %d +NULL -Warning: feof(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: feof() expects parameter 1 to be resource, null given in %s on line %d +NULL -- Iteration 7 -- bool(false) -Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fclose() expects parameter 1 to be resource, Unicode string given in %s on line %d +NULL -Warning: feof(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: feof() expects parameter 1 to be resource, Unicode string given in %s on line %d +NULL diff --git a/ext/standard/tests/file/fflush_error.phpt b/ext/standard/tests/file/fflush_error.phpt index 5f7897fa8f..0e82e47fc1 100644 --- a/ext/standard/tests/file/fflush_error.phpt +++ b/ext/standard/tests/file/fflush_error.phpt @@ -54,36 +54,36 @@ unlink("$file_path/fflush_error.tmp"); *** Testing error conditions *** -- 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 -- 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 -- Testing fflush(): with invalid arguments -- -- Iteration 1 -- -Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fflush() expects parameter 1 to be resource, Unicode string given in %s on line %d +NULL -- Iteration 2 -- -Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fflush() expects parameter 1 to be resource, integer given in %s on line %d +NULL -- Iteration 3 -- -Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fflush() expects parameter 1 to be resource, double given in %s on line %d +NULL -- Iteration 4 -- -Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fflush() expects parameter 1 to be resource, boolean given in %s on line %d +NULL -- Iteration 5 -- -Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fflush() expects parameter 1 to be resource, array given in %s on line %d +NULL -- Iteration 6 -- -Warning: fflush(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fflush() expects parameter 1 to be resource, object given in %s on line %d +NULL *** Done *** diff --git a/ext/standard/tests/file/fgetc_error.phpt b/ext/standard/tests/file/fgetc_error.phpt index 837e1f37aa..2b5ce9e504 100644 --- a/ext/standard/tests/file/fgetc_error.phpt +++ b/ext/standard/tests/file/fgetc_error.phpt @@ -39,35 +39,35 @@ echo "Done\n"; *** Testing error conditions *** -- 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 -- 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 -- Testing fgetc() with invalid arguments -- -- Iteration 1 -- -Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fgetc() expects parameter 1 to be resource, Unicode string given in %s on line %d +NULL -- Iteration 2 -- -Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fgetc() expects parameter 1 to be resource, integer given in %s on line %d +NULL -- Iteration 3 -- -Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fgetc() expects parameter 1 to be resource, double given in %s on line %d +NULL -- Iteration 4 -- -Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fgetc() expects parameter 1 to be resource, boolean given in %s on line %d +NULL -- Iteration 5 -- -Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fgetc() expects parameter 1 to be resource, array given in %s on line %d +NULL -- Iteration 6 -- -Warning: fgetc(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fgetc() expects parameter 1 to be resource, object given in %s on line %d +NULL Done diff --git a/ext/standard/tests/file/fgetss_error.phpt b/ext/standard/tests/file/fgetss_error.phpt index 26af049c24..db071bdfc6 100644 --- a/ext/standard/tests/file/fgetss_error.phpt +++ b/ext/standard/tests/file/fgetss_error.phpt @@ -105,6 +105,6 @@ bool(false) Warning: fgetss() expects parameter 1 to be resource, null given in %s on line %d NULL -Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fclose() expects parameter 1 to be resource, null given in %s on line %d +NULL Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt index 2b0a1b2f8f..3ba3047452 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt @@ -56,44 +56,44 @@ echo "Done\n"; *** Testing fseek() : error conditions *** -- 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 -- 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 -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 -- Testing fseek() with invalid arguments -- -- Iteration 1 -- -Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fseek() expects parameter 1 to be resource, Unicode string given in %s on line %d +NULL -- Iteration 2 -- -Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fseek() expects parameter 1 to be resource, integer given in %s on line %d +NULL -- Iteration 3 -- -Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fseek() expects parameter 1 to be resource, double given in %s on line %d +NULL -- Iteration 4 -- -Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fseek() expects parameter 1 to be resource, boolean given in %s on line %d +NULL -- Iteration 5 -- -Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fseek() expects parameter 1 to be resource, array given in %s on line %d +NULL -- Iteration 6 -- -Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fseek() expects parameter 1 to be resource, object given in %s on line %d +NULL -- Testing fseek() with closed/unset file handle -- Warning: fseek(): 5 is not a valid stream resource in %s on line %d bool(false) -Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: fseek() expects parameter 1 to be resource, null given in %s on line %d +NULL Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt index d5bad92a6c..c24cf0fffa 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt @@ -55,41 +55,41 @@ echo "Done\n"; *** Testing ftell() : error conditions *** -- 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 -- 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 -- Testing ftell() with invalid arguments -- -- Iteration 1 -- -Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftell() expects parameter 1 to be resource, Unicode string given in %s on line %d +NULL -- Iteration 2 -- -Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftell() expects parameter 1 to be resource, integer given in %s on line %d +NULL -- Iteration 3 -- -Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftell() expects parameter 1 to be resource, double given in %s on line %d +NULL -- Iteration 4 -- -Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftell() expects parameter 1 to be resource, boolean given in %s on line %d +NULL -- Iteration 5 -- -Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftell() expects parameter 1 to be resource, array given in %s on line %d +NULL -- Iteration 6 -- -Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftell() expects parameter 1 to be resource, object given in %s on line %d +NULL -- Testing ftell with closed/unset file handle -- Warning: ftell(): 5 is not a valid stream resource in %s on line %d bool(false) -Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftell() expects parameter 1 to be resource, null given in %s on line %d +NULL Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt index 8f0ae38d4f..a56481a53e 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt @@ -55,41 +55,41 @@ echo "Done\n"; *** Testing rewind() : error conditions *** -- 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 -- 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 -- Testing rewind() with invalid arguments -- -- Iteration 1 -- -Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: rewind() expects parameter 1 to be resource, Unicode string given in %s on line %d +NULL -- Iteration 2 -- -Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: rewind() expects parameter 1 to be resource, integer given in %s on line %d +NULL -- Iteration 3 -- -Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: rewind() expects parameter 1 to be resource, double given in %s on line %d +NULL -- Iteration 4 -- -Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: rewind() expects parameter 1 to be resource, boolean given in %s on line %d +NULL -- Iteration 5 -- -Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: rewind() expects parameter 1 to be resource, array given in %s on line %d +NULL -- Iteration 6 -- -Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: rewind() expects parameter 1 to be resource, object given in %s on line %d +NULL -- Testing rewind() with closed/unset file handle -- Warning: rewind(): 5 is not a valid stream resource in %s on line %d bool(false) -Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: rewind() expects parameter 1 to be resource, null given in %s on line %d +NULL Done diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt index a6be930366..5bfe1769b8 100644 --- a/ext/standard/tests/file/ftruncate_error.phpt +++ b/ext/standard/tests/file/ftruncate_error.phpt @@ -76,49 +76,49 @@ unlink( $filename ); Initial file size = 36 -- 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 -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 int(36) -- 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 int(36) -- Testing ftruncate() with invalid file pointer -- -- Iteration 1 -- -Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftruncate() expects parameter 1 to be resource, Unicode string given in %s on line %d +NULL -- Iteration 2 -- -Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftruncate() expects parameter 1 to be resource, integer given in %s on line %d +NULL -- Iteration 3 -- -Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftruncate() expects parameter 1 to be resource, double given in %s on line %d +NULL -- Iteration 4 -- -Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftruncate() expects parameter 1 to be resource, boolean given in %s on line %d +NULL -- Iteration 5 -- -Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftruncate() expects parameter 1 to be resource, array given in %s on line %d +NULL -- Iteration 6 -- -Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftruncate() expects parameter 1 to be resource, object given in %s on line %d +NULL -- Testing ftruncate() with closed/unset file handle -- Warning: ftruncate(): 5 is not a valid stream resource in %s on line %d bool(false) int(36) -Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: ftruncate() expects parameter 1 to be resource, null given in %s on line %d +NULL int(36) Done diff --git a/ext/standard/tests/file/popen_pclose_error.phpt b/ext/standard/tests/file/popen_pclose_error.phpt index 0d33184905..ec40174744 100644 --- a/ext/standard/tests/file/popen_pclose_error.phpt +++ b/ext/standard/tests/file/popen_pclose_error.phpt @@ -41,16 +41,16 @@ NULL Warning: popen() expects exactly 2 parameters, 1 given in %s on line %d NULL -Warning: popen(abc.txt,rw): %s on line %d +Warning: popen(abc.txt,rw): Invalid argument in %s on line %d 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 -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 -Warning: pclose(): supplied argument is not a valid stream resource in %s on line %d -bool(false) +Warning: pclose() expects parameter 1 to be resource, integer given in %s on line %d +NULL --- Done --- diff --git a/ext/standard/tests/file/umask_error.phpt b/ext/standard/tests/file/umask_error.phpt index 6cd02f069d..f09fdcdefd 100644 --- a/ext/standard/tests/file/umask_error.phpt +++ b/ext/standard/tests/file/umask_error.phpt @@ -21,6 +21,6 @@ echo "Done\n"; --EXPECTF-- *** 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 Done