fix bug. update readme.

This commit is contained in:
CismonX 2018-08-08 15:55:57 +08:00
parent e0e5cf2425
commit 3bf72f95e7
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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(&current->arData[pos].val, 1, 0);
}