From 5f200100a8dbe1b70df0bc825c4094bf1f12c064 Mon Sep 17 00:00:00 2001 From: CismonX Date: Thu, 26 Apr 2018 22:05:26 +0800 Subject: [PATCH] Fix bug. Update readme. --- README.md | 4 ++++ src/collections_methods.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 96a9422..48c584d 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ The `Collection` class implements `ArrayAccess` and `Countable` interface intern * `empty()`, `count()` can be used on instance of `Collection`. * Elements can be traversed via `foreach()` keyword. +### 2.3 Notes + +* The `Collection::xxxTo()` methods will preserve the original key-value pairs of destination `Collection` when keys collide. + ## 3. Example Here is a simple example for how to work with arrays gracefully using this extension. diff --git a/src/collections_methods.c b/src/collections_methods.c index 811cf88..8aef7a8 100644 --- a/src/collections_methods.c +++ b/src/collections_methods.c @@ -820,7 +820,7 @@ PHP_METHOD(Collection, get) found = zend_hash_index_find(current, Z_LVAL_P(key)); else { ERR_BAD_KEY_TYPE(); - RETVAL_NULL(); + RETURN_NULL(); } if (found) RETURN_ZVAL(found, 1, 0);