Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74094 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 176 invoked from network); 9 May 2014 12:33:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 May 2014 12:33:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=are.you.winning@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=are.you.winning@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.41 as permitted sender) X-PHP-List-Original-Sender: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.216.41 mail-qa0-f41.google.com Received: from [209.85.216.41] ([209.85.216.41:42799] helo=mail-qa0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/42-15882-53BCC635 for ; Fri, 09 May 2014 08:33:57 -0400 Received: by mail-qa0-f41.google.com with SMTP id dc16so3992203qab.0 for ; Fri, 09 May 2014 05:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=2dk1GO6pua1gKIBzKrYIRphvA3/kwugJmJc2WlhPstw=; b=zBRJXdiZBovMRCJ+vGqTulqf29IrzQ2UWnH3GbfM2UkyyY+9GO02dgFWk5WUjE3IGW aU/0RKZEJG9imMaliCzC5OOvOgN2o9lNuivCOoVRsVhAcJe1iGjKWyqx50eQv+mqmOCC 23ruT8E9pH86ErE0OxvAUYoykKCZhwte8Q5s1cRh7qskp+zG+Qy5ANd3zyQM7dH1sgtK SZyJDPRZkKYBvLspdabU5gWcWIEGd3pygise9NmhJP3r0x7hhHtAkcN/5mx5fzXSZwK8 M13z3JuPyXiphFgtcpFQAY4Ocrr6zxGIznLD1cnl4ba1HXmUQv6enXiZsY9SWx2EZML/ Awzg== MIME-Version: 1.0 X-Received: by 10.140.82.7 with SMTP id g7mr13178483qgd.74.1399638834127; Fri, 09 May 2014 05:33:54 -0700 (PDT) Sender: are.you.winning@gmail.com Received: by 10.229.148.145 with HTTP; Fri, 9 May 2014 05:33:54 -0700 (PDT) Date: Fri, 9 May 2014 13:33:54 +0100 X-Google-Sender-Auth: nllM2bI7kydzLWGDbH8PgmaR7k0 Message-ID: To: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: date_get_last_errors() array format From: daverandom@php.net (Chris Wright) Hi internals, At the moment, date_get_last_errors() returns arrays that are keyed by the character position of where the error was encountered. While it is useful to have this character position available, using it as the array keys means that in the case where more than one error is raised at the same character position only one error message is returned to userland. There are several situations where this can occur, and this is not necessarily incorrect behaviour. This also causes the count fields to report more errors than the number of strings returned. This causes bugs such as https://bugs.php.net/bug.php?id=64975 to be opened - the behaviour exhibited there is by-design, but the accompanying error message gets eaten by the next error at the same position. I propose that the returned array format be modified so that the inner arrays are zero-indexed and the elements are themselves arrays, where the character position is the first element and the error message is the second - unless, that is, anyone has any objections/better ideas. As a side note, I have submitted a PR on Github with a fix for the specific case in the bug mentioned above, which solves the problem by avoiding raising another error at the same character position. I would appreciate it if someone with php-src karma could review and merge it asap. Thanks, Chris