Skip to content

Commit 9f80eaa

Browse files
authored
Merge pull request #296 from davidcole1340/array-key-pub
Pub ArrayKey and update example
2 parents 5415831 + 8c4a7ae commit 9f80eaa

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/types/array.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,17 @@ impl ZendHashTable {
519519
/// # Example
520520
///
521521
/// ```no_run
522-
/// use ext_php_rs::types::ZendHashTable;
522+
/// use ext_php_rs::types::{ZendHashTable, ArrayKey};
523523
///
524524
/// let mut ht = ZendHashTable::new();
525525
///
526526
/// for (key, val) in ht.iter() {
527-
/// // ^ Index if inserted at an index.
528-
/// // ^ Optional string key, if inserted like a hashtable.
529-
/// // ^ Inserted value.
530-
///
527+
/// match &key {
528+
/// ArrayKey::Long(index) => {
529+
/// }
530+
/// ArrayKey::String(key) => {
531+
/// }
532+
/// }
531533
/// dbg!(key, val);
532534
/// }
533535
#[inline]

src/types/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod object;
1313
mod string;
1414
mod zval;
1515

16-
pub use array::ZendHashTable;
16+
pub use array::{ArrayKey, ZendHashTable};
1717
pub use callable::ZendCallable;
1818
pub use class_object::ZendClassObject;
1919
pub use iterable::Iterable;

0 commit comments

Comments
 (0)