diff options
Diffstat (limited to 'ext')
37 files changed, 179 insertions, 181 deletions
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 673de377f6..34993eb5ef 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -658,8 +658,8 @@ PHP_FUNCTION(com_create_guid) GUID retval; OLECHAR *guid_string; - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { + return; } php_com_initialize(TSRMLS_C); diff --git a/ext/curl/multi.c b/ext/curl/multi.c index a931658cb8..1a0e2a8b45 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -55,8 +55,8 @@ PHP_FUNCTION(curl_multi_init) { php_curlm *mh; - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } mh = ecalloc(1, sizeof(php_curlm)); diff --git a/ext/date/php_date.c b/ext/date/php_date.c index fdd7bc2930..ddb1cb85d8 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -298,8 +298,8 @@ struct _php_timezone_obj { php_date_obj *obj; \ DATE_SET_CONTEXT; \ if (object) { \ - if (ZEND_NUM_ARGS()) { \ - WRONG_PARAM_COUNT; \ + if (zend_parse_parameters_none() == FAILURE) { \ + return; \ } \ } else { \ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, date_ce_date) == FAILURE) { \ diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 2421f4309d..61b3bc0c41 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -1200,8 +1200,7 @@ PHP_FUNCTION(dba_list) zend_rsrc_list_entry *le; dba_info *info; - if (ZEND_NUM_ARGS()!=0) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { RETURN_FALSE; } diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index 5408edbfa2..60117d4680 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -138,8 +138,7 @@ entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC); } #define DOM_NO_ARGS() \ - if (ZEND_NUM_ARGS() != 0) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expects exactly 0 parameters, %d given", ZEND_NUM_ARGS()); \ + if (zend_parse_parameters_none() == FAILURE) { \ return; \ } diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c index e333a61406..0783027cbb 100644 --- a/ext/fdf/fdf.c +++ b/ext/fdf/fdf.c @@ -528,8 +528,8 @@ PHP_FUNCTION(fdf_create) FDFDoc fdf; FDFErc err; - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } err = FDFCreate(&fdf); diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 1e3753316b..229d29a4ef 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -835,8 +835,8 @@ PHP_FUNCTION(filter_list) { int i, size = sizeof(filter_list) / sizeof(filter_list_entry); - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } array_init(return_value); diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 6868c68457..3b894d3f79 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1440,8 +1440,7 @@ PHP_MINFO_FUNCTION(gd) */ PHP_FUNCTION(gd_info) { - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { RETURN_FALSE; } @@ -2383,8 +2382,8 @@ PHP_FUNCTION(imagetypes) ret |= 16; #endif - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_LONG(ret); diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 0e9740378e..aad980f7c7 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -3658,8 +3658,8 @@ PHP_FUNCTION(imap_alerts) { STRINGLIST *cur=NIL; - if (ZEND_NUM_ARGS() > 0) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { + return; } if (IMAPG(imap_alertstack) == NIL) { @@ -3685,8 +3685,8 @@ PHP_FUNCTION(imap_errors) { ERRORLIST *cur=NIL; - if (ZEND_NUM_ARGS() > 0) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { + return; } if (IMAPG(imap_errorstack) == NIL) { @@ -3712,8 +3712,8 @@ PHP_FUNCTION(imap_last_error) { ERRORLIST *cur=NIL; - if (ZEND_NUM_ARGS() > 0) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { + return; } if (IMAPG(imap_errorstack) == NIL) { diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index 4bd5d9ef84..e1933c33b3 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -203,8 +203,8 @@ int le_link, le_plink, le_trans; Return error message */ PHP_FUNCTION(ibase_errmsg) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } if (IBG(sql_code) != 0) { @@ -219,8 +219,8 @@ PHP_FUNCTION(ibase_errmsg) Return error code */ PHP_FUNCTION(ibase_errcode) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } if (IBG(sql_code) != 0) { diff --git a/ext/mhash/mhash.c b/ext/mhash/mhash.c index 5354d35594..6861d48adc 100644 --- a/ext/mhash/mhash.c +++ b/ext/mhash/mhash.c @@ -95,8 +95,8 @@ PHP_MINFO_FUNCTION(mhash) Gets the number of available hashes */ PHP_FUNCTION(mhash_count) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_LONG(mhash_count()); diff --git a/ext/ming/ming.c b/ext/ming/ming.c index 98619eacf0..fd70d8f5fc 100644 --- a/ext/ming/ming.c +++ b/ext/ming/ming.c @@ -443,8 +443,8 @@ static SWFBitmap getBitmap(zval *id TSRMLS_DC) Returns the width of this bitmap */ PHP_METHOD(swfbitmap, getWidth) { - if(ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_DOUBLE(SWFBitmap_getWidth(getBitmap(getThis() TSRMLS_CC))); } @@ -454,8 +454,8 @@ PHP_METHOD(swfbitmap, getWidth) Returns the height of this bitmap */ PHP_METHOD(swfbitmap, getHeight) { - if(ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_DOUBLE(SWFBitmap_getHeight(getBitmap(getThis() TSRMLS_CC))); } @@ -1056,9 +1056,9 @@ PHP_METHOD(swfdisplayitem, remove) { SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - + if (zend_parse_parameters_none() == FAILURE) { + return; + } SWFDisplayItem_remove(item); } /* }}} */ @@ -1086,9 +1086,9 @@ PHP_METHOD(swfdisplayitem, endMask) { SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - + if (zend_parse_parameters_none() == FAILURE) { + return; + } SWFDisplayItem_endMask(item); } /* }}} */ @@ -1100,9 +1100,9 @@ PHP_METHOD(swfdisplayitem, getX) float ret; SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - + if (zend_parse_parameters_none() == FAILURE) { + return; + } ret = SWFDisplayItem_get_x(item); RETURN_DOUBLE(ret); } @@ -1115,9 +1115,9 @@ PHP_METHOD(swfdisplayitem, getY) float ret; SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - + if (zend_parse_parameters_none() == FAILURE) { + return; + } ret = SWFDisplayItem_get_y(item); RETURN_DOUBLE(ret); } @@ -1130,9 +1130,9 @@ PHP_METHOD(swfdisplayitem, getXScale) float ret; SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - + if (zend_parse_parameters_none() == FAILURE) { + return; + } ret = SWFDisplayItem_get_xScale(item); RETURN_DOUBLE(ret); } @@ -1145,9 +1145,9 @@ PHP_METHOD(swfdisplayitem, getYScale) float ret; SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - + if (zend_parse_parameters_none() == FAILURE) { + return; + } ret = SWFDisplayItem_get_yScale(item); RETURN_DOUBLE(ret); } @@ -1160,9 +1160,9 @@ PHP_METHOD(swfdisplayitem, getXSkew) float ret; SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - + if (zend_parse_parameters_none() == FAILURE) { + return; + } ret = SWFDisplayItem_get_xSkew(item); RETURN_DOUBLE(ret); } @@ -1175,9 +1175,9 @@ PHP_METHOD(swfdisplayitem, getYSkew) float ret; SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - + if (zend_parse_parameters_none() == FAILURE) { + return; + } ret = SWFDisplayItem_get_ySkew(item); RETURN_DOUBLE(ret); } @@ -1190,9 +1190,9 @@ PHP_METHOD(swfdisplayitem, getRot) float ret; SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - + if (zend_parse_parameters_none() == FAILURE) { + return; + } ret = SWFDisplayItem_get_rot(item); RETURN_DOUBLE(ret); } @@ -1547,8 +1547,8 @@ PHP_METHOD(swffont, getWideWidth) Returns the ascent of the font, or 0 if not available */ PHP_METHOD(swffont, getAscent) { - if(ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_DOUBLE(SWFFont_getAscent(getFont(getThis() TSRMLS_CC))); } @@ -1558,8 +1558,8 @@ PHP_METHOD(swffont, getAscent) Returns the descent of the font, or 0 if not available */ PHP_METHOD(swffont, getDescent) { - if(ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_DOUBLE(SWFFont_getDescent(getFont(getThis() TSRMLS_CC))); } @@ -1569,8 +1569,8 @@ PHP_METHOD(swffont, getDescent) Returns the leading of the font, or 0 if not available */ PHP_METHOD(swffont, getLeading) { - if(ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_DOUBLE(SWFFont_getLeading(getFont(getThis() TSRMLS_CC))); } @@ -1879,9 +1879,9 @@ PHP_METHOD(swfsoundinstance, noMultiple) { SWFSoundInstance inst = getSoundInstance(getThis() TSRMLS_CC); - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - + if (zend_parse_parameters_none() == FAILURE) { + return; + } SWFSoundInstance_setNoMultiple(inst); } /* }}} */ @@ -2031,9 +2031,9 @@ PHP_METHOD(swfvideostream, setdimension) /* {{{ getNumFrames */ PHP_METHOD(swfvideostream, getnumframes) { - if(ZEND_NUM_ARGS() != 0) - WRONG_PARAM_COUNT; - + if (zend_parse_parameters_none() == FAILURE) { + return; + } RETURN_LONG(SWFVideoStream_getNumFrames(getVideoStream(getThis() TSRMLS_CC))); } /* }}} */ @@ -3748,8 +3748,8 @@ PHP_METHOD(swftext, getWideWidth) Returns the ascent of the current font at its current size, or 0 if not available */ PHP_METHOD(swftext, getAscent) { - if(ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_DOUBLE(SWFText_getAscent(getText(getThis() TSRMLS_CC))); } @@ -3759,8 +3759,8 @@ PHP_METHOD(swftext, getAscent) Returns the descent of the current font at its current size, or 0 if not available */ PHP_METHOD(swftext, getDescent) { - if(ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_DOUBLE(SWFText_getDescent(getText(getThis() TSRMLS_CC))); } @@ -3770,8 +3770,8 @@ PHP_METHOD(swftext, getDescent) Returns the leading of the current font at its current size, or 0 if not available */ PHP_METHOD(swftext, getLeading) { - if(ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_DOUBLE(SWFText_getLeading(getText(getThis() TSRMLS_CC))); } diff --git a/ext/msql/php_msql.c b/ext/msql/php_msql.c index 14b3805119..de5920cfa4 100644 --- a/ext/msql/php_msql.c +++ b/ext/msql/php_msql.c @@ -747,8 +747,8 @@ PHP_FUNCTION(msql_list_fields) Returns the text of the error message from previous mSQL operation */ PHP_FUNCTION(msql_error) { - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_STRING(msqlErrMsg,1); } diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 252623ec13..16da0115c7 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -1003,8 +1003,8 @@ PHP_FUNCTION(mysql_select_db) Returns a string that represents the client library version */ PHP_FUNCTION(mysql_get_client_info) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_STRING((char *)mysql_get_client_info(),1); diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index ebee68cdae..1768b00738 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -782,8 +782,8 @@ PHP_FUNCTION(odbc_close_all) int i; int nument; - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } nument = zend_hash_next_free_element(&EG(regular_list)); diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 5c2f443df7..62dbd25148 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -3648,8 +3648,8 @@ PHP_FUNCTION(openssl_error_string) char buf[512]; unsigned long val; - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } val = ERR_get_error(); diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index a9444c1477..24712ee40e 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -972,8 +972,8 @@ static PHP_METHOD(PDO, errorCode) { pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - if (ZEND_NUM_ARGS()) { - RETURN_FALSE; + if (zend_parse_parameters_none() == FAILURE) { + return; } PDO_CONSTRUCT_CHECK; @@ -991,8 +991,8 @@ static PHP_METHOD(PDO, errorInfo) { pdo_dbh_t *dbh = zend_object_store_get_object(getThis() TSRMLS_CC); - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } PDO_CONSTRUCT_CHECK; @@ -1134,8 +1134,8 @@ static PHP_METHOD(PDO, getAvailableDrivers) HashPosition pos; pdo_driver_t **pdriver; - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } array_init(return_value); diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 356962de1d..43656b6f11 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1729,8 +1729,8 @@ static PHP_METHOD(PDOStatement, errorCode) { PHP_STMT_GET_OBJ; - if (ZEND_NUM_ARGS()) { - RETURN_FALSE; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_STRING(stmt->error_code, 1); @@ -1743,8 +1743,8 @@ static PHP_METHOD(PDOStatement, errorInfo) { PHP_STMT_GET_OBJ; - if (ZEND_NUM_ARGS()) { - RETURN_FALSE; + if (zend_parse_parameters_none() == FAILURE) { + return; } array_init(return_value); @@ -1844,8 +1844,8 @@ static PHP_METHOD(PDOStatement, getAttribute) static PHP_METHOD(PDOStatement, columnCount) { PHP_STMT_GET_OBJ; - if (ZEND_NUM_ARGS()) { - RETURN_FALSE; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_LONG(stmt->column_count); } diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 23217caa7d..2e93e2e35c 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -209,7 +209,7 @@ zend_module_entry posix_module_entry = { ZEND_GET_MODULE(posix) #endif -#define PHP_POSIX_NO_ARGS if (ZEND_NUM_ARGS()) WRONG_PARAM_COUNT; +#define PHP_POSIX_NO_ARGS if (zend_parse_parameters_none() == FAILURE) return; #define PHP_POSIX_RETURN_LONG_FUNC(func_name) \ PHP_POSIX_NO_ARGS \ diff --git a/ext/session/session.c b/ext/session/session.c index 9727541a0f..b865254c06 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1411,8 +1411,8 @@ PHP_FUNCTION(session_set_cookie_params) Return the session cookie parameters */ PHP_FUNCTION(session_get_cookie_params) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } array_init(return_value); @@ -1763,8 +1763,8 @@ PHP_FUNCTION(session_encode) int len; char *enc; - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } enc = php_session_encode(&len TSRMLS_CC); @@ -1812,8 +1812,8 @@ PHP_FUNCTION(session_start) Destroy the current session and all data associated with it */ PHP_FUNCTION(session_destroy) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } if (php_session_destroy(TSRMLS_C) == SUCCESS) { diff --git a/ext/skeleton/create_stubs b/ext/skeleton/create_stubs index 61957289d0..0a5f28607e 100755 --- a/ext/skeleton/create_stubs +++ b/ext/skeleton/create_stubs @@ -197,7 +197,7 @@ END { ints = ints "\tint argc = ZEND_NUM_ARGS();\n" fetchargs = fetchargs "argc TSRMLS_CC, " specs[i] } else { - fetchargs = fetchargs "\tif (ZEND_NUM_ARGS() != 0) {\n\t\tWRONG_PARAM_COUNT;\n\t}" + fetchargs = fetchargs "\tif (zend_parse_parameters_none() == FAILURE) {\n\t\treturn;\n\t}" xmlparams = xmlparams " <void/>\n" } diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 4864ee7b25..0a880ca1e0 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -693,8 +693,8 @@ PHP_FUNCTION(snmprealwalk) Return the current status of quick_print */ PHP_FUNCTION(snmp_get_quick_print) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } #ifdef HAVE_NET_SNMP diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 2d09138f48..4e635a42dc 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -821,8 +821,8 @@ PHP_METHOD(SoapFault, __toString) zend_fcall_info fci; zval fname; - if (ZEND_NUM_ARGS() > 0) { - ZEND_WRONG_PARAM_COUNT(); + if (zend_parse_parameters_none() == FAILURE) { + return; } faultcode = zend_read_property(soap_fault_class_entry, this_ptr, "faultcode", sizeof("faultcode")-1, 1 TSRMLS_CC); diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index 4cf7d95377..85933b10fa 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -2426,8 +2426,8 @@ PHP_FUNCTION(sqlite_column) Returns the version of the linked SQLite library. */ PHP_FUNCTION(sqlite_libversion) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_STRING((char*)sqlite_libversion(), 1); } @@ -2437,8 +2437,8 @@ PHP_FUNCTION(sqlite_libversion) Returns the encoding (iso8859 or UTF-8) of the linked SQLite library. */ PHP_FUNCTION(sqlite_libencoding) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_STRING((char*)sqlite_libencoding(), 1); } @@ -2453,8 +2453,8 @@ PHP_FUNCTION(sqlite_changes) zval *object = getThis(); if (object) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT + if (zend_parse_parameters_none() == FAILURE) { + return; } DB_FROM_OBJECT(db, object); } else { @@ -2477,8 +2477,8 @@ PHP_FUNCTION(sqlite_last_insert_rowid) zval *object = getThis(); if (object) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT + if (zend_parse_parameters_none() == FAILURE) { + return; } DB_FROM_OBJECT(db, object); } else { @@ -2514,8 +2514,8 @@ PHP_FUNCTION(sqlite_num_rows) zval *object = getThis(); if (object) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT + if (zend_parse_parameters_none() == FAILURE) { + return; } RES_FROM_OBJECT(res, object); } else { @@ -2543,8 +2543,8 @@ PHP_FUNCTION(sqlite_valid) zval *object = getThis(); if (object) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT + if (zend_parse_parameters_none() == FAILURE) { + return; } RES_FROM_OBJECT(res, object); } else { @@ -2567,8 +2567,8 @@ PHP_FUNCTION(sqlite_has_prev) zval *object = getThis(); if (object) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT + if (zend_parse_parameters_none() == FAILURE) { + return; } RES_FROM_OBJECT(res, object); } else { @@ -2596,8 +2596,8 @@ PHP_FUNCTION(sqlite_num_fields) zval *object = getThis(); if (object) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT + if (zend_parse_parameters_none() == FAILURE) { + return; } RES_FROM_OBJECT(res, object); } else { @@ -2686,8 +2686,8 @@ PHP_FUNCTION(sqlite_rewind) zval *object = getThis(); if (object) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT + if (zend_parse_parameters_none() == FAILURE) { + return; } RES_FROM_OBJECT(res, object); } else { @@ -2721,8 +2721,8 @@ PHP_FUNCTION(sqlite_next) zval *object = getThis(); if (object) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT + if (zend_parse_parameters_none() == FAILURE) { + return; } RES_FROM_OBJECT(res, object); } else { @@ -2756,8 +2756,8 @@ PHP_FUNCTION(sqlite_key) zval *object = getThis(); if (object) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT + if (zend_parse_parameters_none() == FAILURE) { + return; } RES_FROM_OBJECT(res, object); } else { @@ -2780,8 +2780,8 @@ PHP_FUNCTION(sqlite_prev) zval *object = getThis(); if (object) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT + if (zend_parse_parameters_none() == FAILURE) { + return; } RES_FROM_OBJECT(res, object); } else { @@ -2849,8 +2849,8 @@ PHP_FUNCTION(sqlite_last_error) zval *object = getThis(); if (object) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT + if (zend_parse_parameters_none() == FAILURE) { + return; } DB_FROM_OBJECT(db, object); } else { diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 72b2081913..8a9faed615 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1,3 +1,4 @@ + /* +----------------------------------------------------------------------+ | PHP Version 5 | @@ -4866,8 +4867,8 @@ PHP_FUNCTION(time_sleep_until) Get the name of the owner of the current PHP script */ PHP_FUNCTION(get_current_user) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_STRING(php_get_current_user(), 1); diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 11dcb0cf8d..de2bf732c4 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -333,8 +333,8 @@ PHP_FUNCTION(getcwd) char path[MAXPATHLEN]; char *ret=NULL; - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } #if HAVE_GETCWD diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 96d7af9ae4..2707c50da4 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -730,8 +730,8 @@ PHPAPI void php_clear_stat_cache(TSRMLS_D) Clear file stat cache */ PHP_FUNCTION(clearstatcache) { - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } php_clear_stat_cache(TSRMLS_C); } diff --git a/ext/standard/head.c b/ext/standard/head.c index 7728b669f2..be172cefea 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -246,8 +246,8 @@ static void php_head_apply_header_list_to_hash(void *data, void *arg TSRMLS_DC) Return list of headers to be sent / already sent */ PHP_FUNCTION(headers_list) { - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } if (!&SG(sapi_headers).headers) { diff --git a/ext/standard/info.c b/ext/standard/info.c index d3356e7b64..f9402c809f 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -1082,8 +1082,8 @@ PHPAPI char *php_logo_guid(void) PHP_FUNCTION(php_logo_guid) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_STRING(php_logo_guid(), 0); @@ -1095,8 +1095,8 @@ PHP_FUNCTION(php_logo_guid) PHP_FUNCTION(php_real_logo_guid) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_STRINGL(PHP_LOGO_GUID, sizeof(PHP_LOGO_GUID)-1, 1); @@ -1107,8 +1107,8 @@ PHP_FUNCTION(php_real_logo_guid) Return the special ID used to request the PHP logo in phpinfo screens*/ PHP_FUNCTION(php_egg_logo_guid) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_STRINGL(PHP_EGG_LOGO_GUID, sizeof(PHP_EGG_LOGO_GUID)-1, 1); @@ -1119,8 +1119,8 @@ PHP_FUNCTION(php_egg_logo_guid) Return the special ID used to request the Zend logo in phpinfo screens*/ PHP_FUNCTION(zend_logo_guid) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_STRINGL(ZEND_LOGO_GUID, sizeof(ZEND_LOGO_GUID)-1, 1); @@ -1131,8 +1131,8 @@ PHP_FUNCTION(zend_logo_guid) Return the current SAPI module name */ PHP_FUNCTION(php_sapi_name) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } if (sapi_module.name) { diff --git a/ext/standard/rand.c b/ext/standard/rand.c index 1aa8fce8e6..d04094b00f 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -351,8 +351,8 @@ PHP_FUNCTION(mt_rand) Returns the maximum value a random number can have */ PHP_FUNCTION(getrandmax) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_LONG(PHP_RAND_MAX); @@ -363,8 +363,8 @@ PHP_FUNCTION(getrandmax) Returns the maximum value a random number from Mersenne Twister can have */ PHP_FUNCTION(mt_getrandmax) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } /* diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 699c596315..ecd18f9aa9 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -520,8 +520,8 @@ PHP_FUNCTION(stream_get_transports) int stream_xport_len; ulong num_key; - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } if ((stream_xport_hash = php_stream_xport_get_hash())) { @@ -548,8 +548,8 @@ PHP_FUNCTION(stream_get_wrappers) int key_flags, stream_protocol_len = 0; ulong num_key; - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } if ((url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash())) { diff --git a/ext/standard/string.c b/ext/standard/string.c index 51505e413b..cc52e0ba77 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4683,8 +4683,8 @@ PHP_FUNCTION(localeconv) int len, i; /* We don't need no stinkin' parameters... */ - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } MAKE_STD_ZVAL(grouping); diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index 351a477ec1..392f671ac2 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -203,8 +203,8 @@ static void start_syslog(TSRMLS_D) Initializes all syslog-related variables */ PHP_FUNCTION(define_syslog_variables) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } if (!BG(syslog_started)) { @@ -243,8 +243,8 @@ PHP_FUNCTION(openlog) Close connection to system logger */ PHP_FUNCTION(closelog) { - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } closelog(); diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index ecf36cbc18..176acb20de 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -534,8 +534,8 @@ PHP_FUNCTION(stream_get_filters) HashTable *filters_hash; ulong num_key; - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } array_init(return_value); diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index c259ec7ddd..7c39854f29 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -50,8 +50,8 @@ PHPTidyObj *obj; \ TIDY_SET_CONTEXT; \ if (object) { \ - if (ZEND_NUM_ARGS()) { \ - WRONG_PARAM_COUNT; \ + if (zend_parse_parameters_none() == FAILURE) { \ + return; \ } \ } else { \ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, tidy_ce_doc) == FAILURE) { \ @@ -63,8 +63,8 @@ #define TIDY_FETCH_ONLY_OBJECT \ PHPTidyObj *obj; \ TIDY_SET_CONTEXT; \ - if (ZEND_NUM_ARGS()) { \ - WRONG_PARAM_COUNT; \ + if (zend_parse_parameters_none() == FAILURE) { \ + return; \ } \ obj = (PHPTidyObj *) zend_object_store_get_object(object TSRMLS_CC); \ @@ -1204,8 +1204,8 @@ static PHP_FUNCTION(tidy_diagnose) Get release date (version) for Tidy library */ static PHP_FUNCTION(tidy_get_release) { - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } RETURN_STRING((char *)tidyReleaseDate(), 1); diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c index d90f5aaa87..791e624ed3 100644 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ b/ext/xmlrpc/xmlrpc-epi-php.c @@ -794,8 +794,8 @@ PHP_FUNCTION(xmlrpc_decode) Creates an xmlrpc server */ PHP_FUNCTION(xmlrpc_server_create) { - if(ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } if(return_value_used) { diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index 3785348940..fc09ce8fb4 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -464,8 +464,8 @@ static void php_xmlwriter_end(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_read_int_t if (this) { XMLWRITER_FROM_OBJECT(intern, this); - if (ZEND_NUM_ARGS()) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters_none() == FAILURE) { + return; } } else #endif |