1)
OK, pos() and sizeof() remains. 
Maybe have a link to appendix G "List of Function Aliases"?

I've just realized that the doc says there are two kind of alias.
(decrepated ones and very basic ones as earlier mentioned)
It may worth mentioning this difference with a link, or not?

If so, how does this link look? 
    <link linkend="aliases">alias</link>

2)
I'm currently working on the example outputs. I use the following
tagging:

    <example>
      <title><function>foo</function> example</title>
      <programlisting role="php">
<![CDATA[
]]>
      </programlisting>
      <para>
       The printout of the program above will be:
(by default, or the existing description after the examples, if provided)
       <screen role="php">
<![CDATA[
]]>
       </screen>
      </para>
     </example>

is it correct? (I copied from the array_chunk or whatever entry
from the beginning of the array.xml)
 
3)
I looked into the source searching for array_unique. I found the same
implementation in 4.0.6 and 4.1.1 (I haven't got any earlier local 
source). In my understanding this implementation of array_unique 
does remove every duplicates after the first value, and now I can figue
out the meaning of "keeping the first key encountered for every value".

I think it is only a documentation issue. My suggestion is that the 
manual should state:

 " array_unique() sorts the array values (treated as strings?) at first,
 " and then it keeps the first key encountered for every value. It does
 " not mean that the key of the first related value from the unsorted 
 " <parameter>array</parameter> will be kept.

and hopefully everything would be much more clear.
Can anybody familiar with the source approve my proposition or fwd it
to phpdev list?

(here comes the snippet from ext/standard/array.c:)
PHP_FUNCTION(array_unique)
...
 for (i = 0, p = target_hash->pListHead; p; i++, p = p->pListNext)
  arTmp[i] = p;
 arTmp[i] = NULL;
    set_compare_func(SORT_STRING TSRMLS_CC);
 qsort((void *) arTmp, i, sizeof(Bucket *), array_data_compare);

 /* go through the sorted array and delete duplicates from the copy */
 lastkept = arTmp;
 for (cmpdata = arTmp + 1; *cmpdata; cmpdata++) {
  if (array_data_compare(lastkept, cmpdata)) {
          lastkept = cmpdata;
  } else {
   p = *cmpdata;
   if (p->nKeyLength)
           zend_hash_del(Z_ARRVAL_P(return_value), p->arKey, p->nKeyLength);  
   else
           zend_hash_index_del(Z_ARRVAL_P(return_value), p->h);  
  }
 }
...

ps: Not to waste any time I have committed all the changes above 
(rev 1.148). Please make test im my stead  because I haven't set
up my test environment yet.

Papp Gyozo
- [EMAIL PROTECTED]



Reply via email to