note 130522 added to function.array-last

From: Date: Sat, 18 Oct 2025 20:35:57 +0000
Subject: note 130522 added to function.array-last
Groups: php.notes 
Request: Send a blank email to php-notes+get-222388@lists.php.net to get a copy of this message
This seems like such a 'junior with nothing to do' sort of thing to add to PHP; I can think of no purpose for this. To get first array is always array[0], to get last value is array[length-1]. For compatibility it will be pretty bad to add right away, as like 99% won't just update or have 8.5 available. I can only see this be useful in a way like if MySQL has to return 1 value then you may check with 1 line if it's retrieved; but actually, based on the logic of those code, you would retrieve it only after checking the result or numeffected rows if that's a possibility, and bad code will just ignore that and create warnings even in cases when it's possible. So I see nothing useful here at least for existing code as majorly to maintain usability you'd want any practical and good code to just get 1st array value for all versions which is simple for PHP any version. ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 171.96.72.177) ---- Manual Page -- https://php.net/manual/en/function.array-last.php Edit -- https://main.php.net/note/edit/130522 Del: integrated -- https://main.php.net/note/delete/130522/integrated Del: useless -- https://main.php.net/note/delete/130522/useless Del: bad code -- https://main.php.net/note/delete/130522/bad+code Del: spam -- https://main.php.net/note/delete/130522/spam Del: non-english -- https://main.php.net/note/delete/130522/non-english Del: in docs -- https://main.php.net/note/delete/130522/in+docs Del: other reasons-- https://main.php.net/note/delete/130522 Reject -- https://main.php.net/note/reject/130522 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#222388) next »