mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
build fix
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@330074 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
a50871d305
commit
233de1bf69
1 changed files with 61 additions and 62 deletions
|
@ -206,7 +206,7 @@ typedef union _zvalue_value {
|
|||
</tgroup>
|
||||
</table>
|
||||
|
||||
<para>Please check the <xref linkend="features.gc.refcounting-basics"/> chapter for details how reference counting and references work.</para>
|
||||
<para>Please check the <xref linkend="features.gc.refcounting-basics"/> chapter for details how reference counting and references work in detail.</para>
|
||||
|
||||
<table xml:id="internals2.variables.refcounts.api">
|
||||
<title>Reference Count Manipulation</title>
|
||||
|
@ -343,7 +343,7 @@ typedef union _zvalue_value {
|
|||
</table>
|
||||
|
||||
<note>
|
||||
<para>Objects and Resources have a secondary reference counting ability, when zval_ptr_dtor is called on either, their appropriate del_ref method is executed. See Working with Objects and Working with Resources for more information.</para>
|
||||
<para>Objects and Resources have a reference count as part of their respective structures, when zval_ptr_dtor is called on either, their appropriate del_ref method is executed. See Working with Objects and Working with Resources for more information.</para>
|
||||
</note>
|
||||
|
||||
<para>PHP is weakly typed, as such the engine provides API functions for converting variables from one type to another.</para>
|
||||
|
@ -614,11 +614,11 @@ typedef union _zvalue_value {
|
|||
<section xml:id="internals2.variables.tables">
|
||||
<title>Working with HashTable</title>
|
||||
|
||||
<para>The HashTable structure serves many purposes in PHP and can be found everywhere, a good understanding of it's functionality is a preqrequisite of being a good <code>Hacker</code>.</para>
|
||||
<para>The <code>HashTable</code> structure serves many purposes in PHP and can be found everywhere, a good understanding of it's functionality is a preqrequisite of being a good <code>Hacker</code>.</para>
|
||||
|
||||
<para>The HashTable implemented by the engine is a standard HashTable, that is to say, a key = > value based store, where the keys are always strings, whose hashes are calculated with a built in hashing algorythim <code>zend_inline_hash_func(const char* key, uint length)</code>, which results in good distribution, and reasonable usage.</para>
|
||||
<para>The <code>HashTable</code> implemented by the engine is a standard <code>HashTable</code>, that is to say, a key => value based store, where the keys are always strings, whose hashes are calculated with a built in hashing algorythim <code>zend_inline_hash_func(const char* key, uint length)</code>, which results in good distribution, and reasonable usage.</para>
|
||||
|
||||
<para>The internal structure and exact operation of HashTables are out of the scope of this document, this document serves to inform you of the API's available and how best to use them. For a more detailed picture of the HashTable see <code>Zend/zend_hash.h</code>.</para>
|
||||
<para>The internal structure and exact operation of <code>HashTable</code> is out of the scope of this document, this document serves to inform you of the API's available and how best to use them. For a more detailed picture of the HashTable see <code>Zend/zend_hash.h</code>.</para>
|
||||
|
||||
<para>Unless otherwise stated, these functions all return <code>FAILURE</code> if the requested opeation fails for any reason, otherwise <code>SUCCESS</code> is returned.</para>
|
||||
|
||||
|
@ -659,7 +659,7 @@ typedef union _zvalue_value {
|
|||
</row>
|
||||
|
||||
<row>
|
||||
<entry>searches the table for <code>key</code>, setting <code>*data</code> and returning SUCCESS when it is found.</entry>
|
||||
<entry>searches the table for <code>key</code>, setting <code>*data</code> and returning SUCCESS if it is found.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
|
@ -687,67 +687,66 @@ typedef union _zvalue_value {
|
|||
<caution>
|
||||
<para>zend_hash_* functions that accept <code>void* data</code> should normally cast it to <code>(void**)</code> (ie, <code>(void**) &data</code>)</para>
|
||||
</caution>
|
||||
</section>
|
||||
|
||||
<para>Traversing the HashTable is often necessary, to do this you provide a pointer to a <code>HashTable</code>, with an optional <code>HashPosition</code> - a structure internal to the HashTable API that allows traversal not to affect the internal position of HashTable. The following traversal functions are provided, and an example usage found below.</para>
|
||||
|
||||
<table xml:id="internals2.variables.trarrays.api">
|
||||
<title>HashTable Traversal API</title>
|
||||
<tgroup cols="1">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><code>int zend_hash_internal_pointer_reset(HashTable* ht)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>resets the internal pointer of <code>ht</code> to the start</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_internal_pointer_reset_ex(HashTable* ht, HashPosition position)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>sets <code>position</code> the the start of <code>ht</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_get_current_data(HashTable* ht, void* data)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>gets the data at the current position in <code>ht</code>, <code>data</code> should be cast to <code>void**</code>, ie: <code>(void**) &data</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_get_current_data_ex(HashTable* ht, void* data, HashPosition position)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>sets <code>data</code> to the data at <code>position</code> in <code>ht</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_get_current_key(HashTable* ht, void* data, char**key, uint klen, ulong index, zend_bool duplicate)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>sets <code>key</code>, <code>klen</code>, and <code>index</code> from the key information at the current position. The possible return values HASH_KEY_IS_STRING and HASH_KEY_IS_LONG are indicative of the kind of key found at the current posision.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_get_current_key_ex(HashTable* ht, void* data, char**key, uint klen, ulong index, zend_bool duplicate, HashPosition position)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>sets <code>key</code>, <code>klen</code>, and <code>index</code> from the key information at <code>position</code>. The possible return values HASH_KEY_IS_STRING and HASH_KEY_IS_LONG are indicative of the kind of key found at <code>position</code>.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_move_forward(HashTable* ht)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>moves the internal pointer of <code>ht</code> to the next entry in <code>ht</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_move_forward_ex(HashTable* ht, HashPosition position)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>moves <code>position</code> to the next entry in <code>ht</code> </entry>
|
||||
</row>
|
||||
</tbody>
|
||||
<title>HashTable Traversal API</title>
|
||||
<tgroup cols="1">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><code>int zend_hash_internal_pointer_reset(HashTable* ht)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>resets the internal pointer of <code>ht</code> to the start</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_internal_pointer_reset_ex(HashTable* ht, HashPosition position)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>sets <code>position</code> the the start of <code>ht</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_get_current_data(HashTable* ht, void* data)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>gets the data at the current position in <code>ht</code>, <code>data</code> should be cast to <code>void**</code>, ie: <code>(void**) &data</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_get_current_data_ex(HashTable* ht, void* data, HashPosition position)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>sets <code>data</code> to the data at <code>position</code> in <code>ht</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_get_current_key(HashTable* ht, void* data, char**key, uint klen, ulong index, zend_bool duplicate)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>sets <code>key</code>, <code>klen</code>, and <code>index</code> from the key information at the current position. The possible return values HASH_KEY_IS_STRING and HASH_KEY_IS_LONG are indicative of the kind of key found at the current posision.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_get_current_key_ex(HashTable* ht, void* data, char**key, uint klen, ulong index, zend_bool duplicate, HashPosition position)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>sets <code>key</code>, <code>klen</code>, and <code>index</code> from the key information at <code>position</code>. The possible return values <code>HASH_KEY_IS_STRING</code> and <code>HASH_KEY_IS_LONG</code> are indicative of the kind of key found at <code>position</code>.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_move_forward(HashTable* ht)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>moves the internal pointer of <code>ht</code> to the next entry in <code>ht</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><code>int zend_hash_move_forward_ex(HashTable* ht, HashPosition position)</code></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>moves <code>position</code> to the next entry in <code>ht</code> </entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
<para>The functions above allow traversal over a <code>HashTable</code> to look much like a normal loop, which will look something like:</para>
|
||||
<para>The functions above allow traversal over a <code>HashTable</code> to be much like a normal loop, which will look something like:</para>
|
||||
|
||||
<screen>
|
||||
<![CDATA[
|
||||
|
@ -771,7 +770,7 @@ for (zend_hash_internal_pointer_reset_ex(ht, &position);
|
|||
}
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</screen>
|
||||
|
||||
<note>
|
||||
<para>If a <code>HashTable</code> has been passed into the engine, it is a good idea to use the zend_hash_*_ex API to avoid unexpected behaviour in userland.</para>
|
||||
|
@ -781,9 +780,9 @@ for (zend_hash_internal_pointer_reset_ex(ht, &position);
|
|||
<para>If a <code>duplicate</code> of the key is requested and <code>HAS_KEY_IS_STRING</code> is returned the caller must <code>efree</code> the duplicated key</para>
|
||||
</note>
|
||||
|
||||
|
||||
<!-- copying/merging/cleaning here -->
|
||||
|
||||
</section>
|
||||
<section xml:id="internals2.variables.objects">
|
||||
<title>Working with Objects</title>
|
||||
<para>
|
||||
|
|
Loading…
Reference in a new issue