1137c1137 < zend_function *function; --- > zend_function *new_function, *existing_function; 1139,1142c1139,1150 < zend_hash_find(function_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void *) &function); < if (zend_hash_add(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, function, sizeof(zend_function), NULL)==FAILURE) { < int error_level = compile_time ? E_COMPILE_ERROR : E_ERROR; < zend_function *function; --- > zend_hash_find(function_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void *) &new_function); > existing_function = new_function; > > if (zend_hash_find(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void *) &existing_function)==SUCCESS > && existing_function->type==ZEND_USER_FUNCTION > && ((zend_op_array *) existing_function)->last>0) { > > /* check to see if the current function and the existing function are the same */ > /* if they are only issue a NOTICE. If they are different, issue an ERROR. */ > if(compile_time && > ((zend_op_array *) existing_function)->filename == ((zend_op_array *) new_function)->filename && > ((zend_op_array *) existing_function)->opcodes[0].lineno == ((zend_op_array *) new_function)->opcodes[0].lineno){ 1144,1147c1152 < if (zend_hash_find(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void *) &function)==SUCCESS < && function->type==ZEND_USER_FUNCTION < && ((zend_op_array *) function)->last>0) { < zend_error(error_level, "Cannot redeclare %s() (previously declared in %s:%d)", --- > zend_error(E_NOTICE, "Function %s() previously declared in %s on line %d)", 1149,1150c1154,1155 < ((zend_op_array *) function)->filename, < ((zend_op_array *) function)->opcodes[0].lineno); --- > ((zend_op_array *) existing_function)->filename, > ((zend_op_array *) existing_function)->opcodes[0].lineno); 1152c1157,1161 < zend_error(error_level, "Cannot redeclare %s()", opline->op2.u.constant.value.str.val); --- > > zend_error(E_ERROR, "Cannot redeclare %s() (previously declared in %s:%d)", > opline->op2.u.constant.value.str.val, > ((zend_op_array *) existing_function)->filename, > ((zend_op_array *) existing_function)->opcodes[0].lineno); 1153a1163,1165 > > } else { > if(zend_hash_add(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, new_function, sizeof(zend_function), NULL)==FAILURE){ 1156,1157c1168,1169 < (*function->op_array.refcount)++; < function->op_array.static_variables = NULL; /* NULL out the unbound function */ --- > (*new_function->op_array.refcount)++; > new_function->op_array.static_variables = NULL; /* NULL out the unbound function */ 1160a1173,1174 > > }