diff --git a/README.md b/README.md index ce9f2b1..fb35a47 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ Method names and functionalities are inspired by [Kotlin.Collections](https://ko ### 1.1 Notes -* This extension requires PHP 7.1 and above. +* Requires PHP 7.1 and above. +* Currently not working on MacOS. Fix in progress. ## 2. Documentation diff --git a/src/collections_methods.c b/src/collections_methods.c index d69d23a..cc98a33 100644 --- a/src/collections_methods.c +++ b/src/collections_methods.c @@ -1009,7 +1009,7 @@ PHP_METHOD(Collection, last) RETURN_NULL(); if (EX_NUM_ARGS() == 0) { HashPosition pos = current->nNumUsed; - while (pos >= 0 && Z_ISUNDEF(current->arData[pos].val)) + while (pos <= current->nNumUsed && Z_ISUNDEF(current->arData[pos].val)) --pos; RETURN_ZVAL(¤t->arData[pos].val, 1, 0); }