mirror of
https://github.com/danog/ext-php-rs.git
synced 2024-11-30 04:39:04 +01:00
Merge pull request #296 from davidcole1340/array-key-pub
Pub ArrayKey and update example
This commit is contained in:
commit
9f80eaa8bc
@ -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]
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user