> For the complete documentation index, see [llms.txt](https://arrayutils.docs.present.kim/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://arrayutils.docs.present.kim/methods/g/last.md).

# last()

{% code title="Example.php" %}

```php
<?php use kim\present\utils\arrays\ArrayUtils;

$arrayUtils = ArrayUtils::from(["Apple", "Banana", "Carrot"]);

//Gets last value
$arrayUtils->last();
// expected output: "Carrot"
```

{% endcode %}

## Syntax

```php
$arrayUtils->last() : mixed;
```

### Return value

* A last value of array. If array is empty, returns `NULL`.

## Prefixing

```php
ArrayUtils::lastFrom(iterable $from) : mixed;
```
