Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102289 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94567 invoked from network); 18 Jun 2018 00:34:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jun 2018 00:34:07 -0000 Authentication-Results: pb1.pair.com header.from=enno.woortmann@web.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=enno.woortmann@web.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain web.de designates 212.227.17.11 as permitted sender) X-PHP-List-Original-Sender: enno.woortmann@web.de X-Host-Fingerprint: 212.227.17.11 mout.web.de Received: from [212.227.17.11] ([212.227.17.11:45275] helo=mout.web.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/F0-29356-DFDF62B5 for ; Sun, 17 Jun 2018 20:34:06 -0400 Received: from [192.168.0.51] ([77.21.86.66]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lzb94-1gGIiR0gYE-014maj; Mon, 18 Jun 2018 02:34:01 +0200 To: niel , internals@lists.php.net References: <75db877c-ef0b-7d3b-48a8-9879d90352b0@web.de> <7052a9c2-7c19-a382-8967-8fda648569df@blueyonder.co.uk> <76e4744f-6722-ee49-0325-e4433236f1b1@web.de> Message-ID: Date: Mon, 18 Jun 2018 02:34:01 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Antivirus: Avast (VPS 180617-4, 17.06.2018), Outbound message X-Antivirus-Status: Clean X-Provags-ID: V03:K1:2jg7uSo6T5xGwpLmYKZAaTRC129lB3FvKWf3Rf0+fTNw/72h4vp DXKg8W9KwPKeiuhv0XSKvgoTsZkWEt3eU+VdPhfQ/cywpMefQG4hbdkYgBCrFnBPigelF0C L52gJERHqPZTOxSrZK5MzUaPqd8cfYyzQgZYSuruki6eTxpKFoGQG2x7Gvaqsne4QQ5cfXL lyzZQmtWDfsvyAl/Yx+sw== X-UI-Out-Filterresults: notjunk:1;V01:K0:3HMrNly/Kbk=:PBBMw3JKcNESDmtFke82c6 7qx29ow6Q3pF7P221Bw0HE8Ibvhhzb+ZDwY7kCxs+Q74FFY1fRetGl7M23mk53STYKYJpIXbA r8JOgiBqi8FUKWLxFojpAqyfQD2Obg37EKReb4VVUEmycYGN9HxhPMK197n2UqZuhej+TNqk2 FXOpmyTXcMODLlepeJNr7COVFeNs9iyT+a8shn8yhqCGxMgrzhr7zkXsEhdoLGZZ4Jgb4jkMV QmVnxeg33hvb+qUwEGk8t/lYpN7SzzahR4xxAhLm31Ne/9NWz+61O3HIzB79k9pkBaByZIQm0 mQDeCXHYCo9KCa7pWhKFoh5Gbt7JTA3rkh0tYwxm7C63E+eCN6v9vYjqdH5SZsxdupJ0APyXZ 1spQ4IBo1jvw/2YOWs6rHlR/5P0v3KcsYbaptIDAZiiTKkZjA0XuM4FTSJ9QwHbRS37pHITIt MeWGF+o4ocBzlLCTvZEi/BQHwtYRxU6TMQoj/KyMTyT75yRlA9ZkPCvGZ24lm6I+3+oBamS8+ zmx1OsN9Q5lQYWbxUYmVOvXLfm2V/sFacZTooQnojs+Z+/WcSU7qK+y6utFlNwCyBfdXVUIf0 UJS9CTiFWTdubZrWzLm6Im4ndDJ0F/baEb8KP+YOSOMN5eHshRFYmm0jmgVLLK7fjzoZcHZcV 3Qe5IvrgDjyxih1P2dYqeGgYOKvRQsBFgQKuEGfG8ZB+cB96vw5fCgU37OqElSr5oTsiYdkr/ 6cbi0fFiurKoE3eJo/MYRT/fbJX/arVfNXIvcpLV/SvYr5AA+B5Xnl+WEPY5K4QEQxUYlI5EH jPGyiqD Subject: Re: [PHP-DEV] [RFC][Under Discussion] Add functions array_key_first() and array_key_last() From: enno.woortmann@web.de (Enno Woortmann) Hi niel, Am 18.06.2018 um 01:59 schrieb niel: > However my main concern that a non-array variable or a non-existent=20 > value, are an error and need to be handled appropriately, has not=20 > changed. IMO, a notice/warning does little to nothing in helping the=20 > programmer determine the problem and track down the cause. Which=20 > leaves one having to wrap these functions in 'if (is_array($var) &&=20 > !empty($var)) {...}' to prevent the possibility. The current implementation is eqivalent to the other array_* functions=20 as shown in the previous mail and can be checked in https://github.com/php/php-src/pull/3256/commits/ec2332be93272d202a2a5cef= 841c266f77f64b08#diff-e00a584724b997f38e851e15f1e20c39 I can comprehend your doubts about the return value but currently I=20 can't imagine a solution which would suite the case better than null=20 especially if we think about extending the scope to=20 array_value_(first|last). Do you/anyone have an idea how we can provide better information towards = the programmer to determine the issue? Enno