Returns the character count of str */
PHP_FUNCTION(iconv_strlen)
{
- char *charset;
+ char *charset = ICONVG(internal_encoding);
int charset_len = 0;
zstr str;
int str_len, argc = ZEND_NUM_ARGS();
unsigned int retval;
- charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(argc TSRMLS_CC, "t|s",
&str, &str_len, &str_type, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
Returns specified part of a string */
PHP_FUNCTION(iconv_substr)
{
- char *charset;
+ char *charset = ICONVG(internal_encoding);
int charset_len = 0;
zstr str;
int str_len;
zend_uchar str_type;
- long offset, length;
+ long offset, length = 0;
php_iconv_err_t err;
smart_str retval = {0};
- charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tl|ls",
&str, &str_len, &str_type, &offset, &length,
&charset, &charset_len) == FAILURE) {
Finds position of first occurrence of needle within part of haystack beginning with offset */
PHP_FUNCTION(iconv_strpos)
{
- char *charset;
+ char *charset = ICONVG(internal_encoding);
int charset_len = 0;
zstr haystk;
int haystk_len;
zstr ndl;
int ndl_len;
zend_uchar ndl_type;
- long offset;
+ long offset = 0;
php_iconv_err_t err;
unsigned int retval;
- offset = 0;
- charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "TT|ls",
&haystk, &haystk_len, &haystk_type, &ndl, &ndl_len, &ndl_type,
&offset, &charset, &charset_len) == FAILURE) {
Finds position of last occurrence of needle within part of haystack beginning with offset */
PHP_FUNCTION(iconv_strrpos)
{
- char *charset;
+ char *charset = ICONVG(internal_encoding);
int charset_len = 0;
char *haystk;
int haystk_len;
unsigned int retval;
- charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s",
&haystk, &haystk_len, &ndl, &ndl_len,
&charset, &charset_len) == FAILURE) {
{
char *encoded_str;
int encoded_str_len;
- char *charset;
+ char *charset = ICONVG(internal_encoding);
int charset_len = 0;
long mode = 0;
php_iconv_err_t err;
- charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls",
&encoded_str, &encoded_str_len, &mode, &charset, &charset_len) == FAILURE) {
{
const char *encoded_str;
int encoded_str_len;
- char *charset;
+ char *charset = ICONVG(internal_encoding);
int charset_len = 0;
long mode = 0;
php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
- charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls",
&encoded_str, &encoded_str_len, &mode, &charset, &charset_len) == FAILURE) {
PHP_FUNCTION(iconv_get_encoding)
{
char *type = "all";
- int type_len;
+ int type_len = sizeof("all")-1;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &type_len) == FAILURE)
return;
Returns a string containing information about the most recent query */
PHP_FUNCTION(mysql_info)
{
- zval *mysql_link;
+ zval *mysql_link = NULL;
int id = -1;
char *str;
php_mysql_conn *mysql;
#endif
if (into_object) {
- char *class_name;
- int class_name_len;
+ char *class_name = NULL;
+ int class_name_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s&z", &res, &class_name, &class_name_len, UG(utf8_conv), &ctor_params) == FAILURE) {
return;
{
spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
char delimiter = intern->u.file.delimiter, enclosure = intern->u.file.enclosure, escape = intern->u.file.escape;
- char *delim, *enclo, *esc;
- int d_len, e_len, esc_len;
+ char *delim = NULL, *enclo = NULL, *esc = NULL;
+ int d_len = 0, e_len = 0, esc_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
switch(ZEND_NUM_ARGS())
{
spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
char delimiter = ',', enclosure = '"', escape='\\';
- char *delim, *enclo, *esc;
- int d_len, e_len, esc_len;
+ char *delim = NULL, *enclo = NULL, *esc = NULL;
+ int d_len = 0, e_len = 0, esc_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
switch(ZEND_NUM_ARGS())
}
case DIT_IteratorIterator: {
zend_class_entry **pce_cast;
- char * class_name;
- int class_name_len;
+ char * class_name = NULL;
+ int class_name_len = 0;
/* UTODO: class_name must be zstr */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|s", &zobject, ce_inner, &class_name, &class_name_len) == FAILURE) {
PHP_FUNCTION(array_splice)
{
zval *array, /* Input array */
- *repl_array, /* Replacement array */
+ *repl_array = NULL, /* Replacement array */
***repl = NULL; /* Replacement elements */
HashTable *new_hash = NULL, /* Output array's hash */
**rem_hash = NULL; /* Removed elements' hash */
Bucket *p; /* Bucket used for traversing hash */
long i,
offset,
- length,
+ length = 0,
repl_num = 0; /* Number of replacement elements */
int num_in; /* Number of elements in the input array */
PHP_FUNCTION(array_slice)
{
zval *input, /* Input array */
- **z_length, /* How many elements to get */
+ **z_length = NULL, /* How many elements to get */
**entry; /* An array entry */
long offset, /* Offset to get elements from */
length = 0;
zval *retval;
zend_fcall_info fci;
zend_fcall_info_cache fci_cache = empty_fcall_info_cache;
- zval *initial;
+ zval *initial = NULL;
HashPosition pos;
HashTable *htbl;
Set/get the various assert flags */
PHP_FUNCTION(assert_options)
{
- zval **value;
+ zval **value = NULL;
long what;
int oldint;
int ac = ZEND_NUM_ARGS();
PHP_FUNCTION(error_log)
{
char *message, *opt = NULL, *headers = NULL;
- int message_len, opt_len, headers_len;
+ int message_len, opt_len = 0, headers_len = 0;
int opt_err = 0, argc = ZEND_NUM_ARGS();
- long erropt;
+ long erropt = 0;
if (zend_parse_parameters(argc TSRMLS_CC, "s|lss", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) {
return;
PHP_FUNCTION(ignore_user_abort)
{
char *arg = NULL;
- int arg_len;
+ int arg_len = 0;
int old_setting;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s&", &arg, &arg_len, UG(ascii_conv)) == FAILURE) {
PHP_FUNCTION(get_browser)
{
char *agent_name = NULL;
- int agent_name_len;
+ int agent_name_len = 0;
zend_bool return_array = 0;
zval **agent, **z_agent_name;
zval *found_browser_entry, *tmp_copy;
{
char salt[PHP_MAX_SALT_LEN + 1];
char *str, *salt_in = NULL;
- int str_len, salt_in_len;
+ int str_len, salt_in_len = 0;
salt[0] = salt[PHP_MAX_SALT_LEN] = '\0';
Return or change the umask */
PHP_FUNCTION(umask)
{
- long arg1;
+ long arg1 = 0;
int oldumask;
int arg_count = ZEND_NUM_ARGS();
int ret;
zval *fp = NULL, *fields = NULL, **field_tmp = NULL, field;
char *delimiter_str = NULL, *enclosure_str = NULL;
- int delimiter_str_len, enclosure_str_len;
+ int delimiter_str_len = 0, enclosure_str_len = 0;
HashPosition pos;
int count, i = 0;
smart_str csvline = {0};
{
zend_bool clear_realpath_cache = 0;
char *filename = NULL;
- zend_uchar filename_type;
- int filename_len;
+ zend_uchar filename_type = 0;
+ int filename_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bt", &clear_realpath_cache, &filename, &filename_len, &filename_type) == FAILURE) {
return;
Returns true if headers have already been sent, false otherwise */
PHP_FUNCTION(headers_sent)
{
- zval *arg1, *arg2;
+ zval *arg1 = NULL, *arg2 = NULL;
char *file="";
int line=0;
{
zstr str;
char *hint_charset = NULL;
- int str_len, hint_charset_len, len;
+ int str_len, hint_charset_len = 0, len;
char *str_utf8;
int str_utf8_len;
zend_uchar type;
Output a page of useful information about PHP and the current request */
PHP_FUNCTION(phpinfo)
{
- int argc = ZEND_NUM_ARGS();
- long flag;
+ long flag = PHP_INFO_ALL;
- if (zend_parse_parameters(argc TSRMLS_CC, "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
return;
}
- if(!argc) {
- flag = PHP_INFO_ALL;
- }
-
/* Andale! Andale! Yee-Hah! */
php_output_start_default(TSRMLS_C);
php_print_info(flag TSRMLS_CC);
Prints the list of people who've contributed to the PHP project */
PHP_FUNCTION(phpcredits)
{
- int argc = ZEND_NUM_ARGS();
- long flag;
+ long flag = PHP_CREDITS_ALL;
- if (zend_parse_parameters(argc TSRMLS_CC, "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
return;
}
- if(!argc) {
- flag = PHP_CREDITS_ALL;
- }
-
php_print_credits(flag TSRMLS_CC);
RETURN_TRUE;
}
PHP_FUNCTION(php_uname)
{
char *mode = "a";
- int modelen;
+ int modelen = sizeof("a")-1;
char *tmp;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &mode, &modelen) == FAILURE) {
{
char *to=NULL, *message=NULL, *headers=NULL;
char *subject=NULL, *extra_cmd=NULL;
- int to_len, message_len, headers_len;
- int subject_len, extra_cmd_len, i;
+ int to_len, message_len, headers_len = 0;
+ int subject_len, extra_cmd_len = 0, i;
char *force_extra_parameters = INI_STR("mail.force_extra_parameters");
char *to_r, *subject_r;
char *p, *e;
{
zval **ppcommand, **ppcwd = NULL;
char *command, *cwd=NULL;
- int command_len, cwd_len;
+ int command_len, cwd_len = 0;
zval *descriptorspec;
zval *pipes;
zval *environment = NULL;
Seeds random number generator */
PHP_FUNCTION(srand)
{
- long seed;
+ long seed = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE)
return;
Seeds Mersenne Twister random number generator */
PHP_FUNCTION(mt_srand)
{
- long seed;
+ long seed = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE)
return;
PHP_FUNCTION(stream_set_timeout)
{
zval *socket;
- long seconds, microseconds;
+ long seconds, microseconds = 0;
struct timeval t;
php_stream *stream;
int argc = ZEND_NUM_ARGS();
Enable or disable a specific kind of crypto on the stream */
PHP_FUNCTION(stream_socket_enable_crypto)
{
- long cryptokind;
+ long cryptokind = 0;
zval *zstream, *zsessstream = NULL;
php_stream *stream, *sessstream = NULL;
zend_bool enable;
void *s1, *s2;
int len1, len2;
zend_uchar type1, type2;
- long start, len; /* For UNICODE, these are codepoint units */
+ long start = 0, len = 0; /* For UNICODE, these are codepoint units */
- start = 0;
- len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "TT|ll",
&s1, &len1, &type1, &s2, &len2, &type2,
&start, &len) == FAILURE) {
Translates characters in str using given translation tables */
PHP_FUNCTION(strtr)
{
- zstr str, to;
- int str_len, to_len;
+ zstr str, to = NULL_ZSTR;
+ int str_len, to_len = 0;
zend_uchar str_type, to_type;
zval **from;
int ac = ZEND_NUM_ARGS();
*/
static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensitivity)
{
- zval *subject, *search, *replace, **subject_entry, *zcount;
+ zval *subject, *search, *replace, **subject_entry, *zcount = NULL;
zval *result;
zstr string_key;
uint string_key_len;
PHP_FUNCTION(str_word_count)
{
zstr str, char_list = NULL_ZSTR;
- int str_len, char_list_len, word_count = 0;
+ int str_len, char_list_len = 0, word_count = 0;
zend_uchar str_type;
long type = 0;
Returns true if var is callable. */
PHP_FUNCTION(is_callable)
{
- zval *var, **callable_name;
+ zval *var, **callable_name = NULL;
zval name;
zend_bool retval;
zend_bool syntax_only = 0;
PHP_FUNCTION(version_compare)
{
- char *v1, *v2, *op;
- int v1_len, v2_len, op_len;
+ char *v1, *v2, *op = NULL;
+ int v1_len, v2_len, op_len = 0;
int compare, argc;
argc = ZEND_NUM_ARGS();