[PHP-NOTES] note 130680 added to function.array-last

[email protected] ("[email protected]") Wed, 11 Mar 2026 14:21:06 +0000
Newsgroups php.notes
Message-ID <[email protected]>
For PHP <= 8.4.0 :

<?php

if (! function_exists('array_last')) {
    function array_last(array $array) {
        return $array === [] ? null : $array[count($array) - 1];
    }
}

?>
----
Server IP: 206.189.2.9
Probable Submitter: 2001:1c06:2805:2d00:ec54:cad6:9888:dd37
----
Manual Page -- https://php.net/manual/en/function.array-last.php
Edit        -- https://main.php.net/note/edit/130680
Del: integrated  -- https://main.php.net/note/delete/130680/integrated
Del: useless     -- https://main.php.net/note/delete/130680/useless
Del: bad code    -- https://main.php.net/note/delete/130680/bad+code
Del: spam        -- https://main.php.net/note/delete/130680/spam
Del: non-english -- https://main.php.net/note/delete/130680/non-english
Del: in docs     -- https://main.php.net/note/delete/130680/in+docs
Del: other reasons-- https://main.php.net/note/delete/130680
Reject      -- https://main.php.net/note/reject/130680
Search      -- https://main.php.net/manage/user-notes.php