Merge pull request #296 from davidcole1340/array-key-pub

Pub ArrayKey and update example
This commit is contained in:
Daniil Gentili 2023-11-28 11:09:56 +01:00 committed by GitHub
commit 9f80eaa8bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -519,15 +519,17 @@ impl ZendHashTable {
/// # Example
///
/// ```no_run
/// use ext_php_rs::types::ZendHashTable;
/// use ext_php_rs::types::{ZendHashTable, ArrayKey};
///
/// let mut ht = ZendHashTable::new();
///
/// for (key, val) in ht.iter() {
/// // ^ Index if inserted at an index.
/// // ^ Optional string key, if inserted like a hashtable.
/// // ^ Inserted value.
///
/// match &key {
/// ArrayKey::Long(index) => {
/// }
/// ArrayKey::String(key) => {
/// }
/// }
/// dbg!(key, val);
/// }
#[inline]

View File

@ -13,7 +13,7 @@ mod object;
mod string;
mod zval;
pub use array::ZendHashTable;
pub use array::{ArrayKey, ZendHashTable};
pub use callable::ZendCallable;
pub use class_object::ZendClassObject;
pub use iterable::Iterable;