Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119025 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21519 invoked from network); 24 Nov 2022 08:25:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Nov 2022 08:25:12 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E46711804F5 for ; Thu, 24 Nov 2022 00:25:08 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 24 Nov 2022 00:25:05 -0800 (PST) Received: by mail-wm1-f50.google.com with SMTP id 5so761242wmo.1 for ; Thu, 24 Nov 2022 00:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=r4wjMbbebvFOxQwlpTJ/d+00q8dKw5DASSdA9l3XQvM=; b=ZgKXDxFrAb1umZQnXu8Kk43gXL5X/TJZ1rT+iCFAnfW8euTz4nG4YF/03SmBEcBl0b 9p47/5WPkc5RUrFcAYipq/6SCAmfnr5aBqzfWRS9w6VIB98sYHRDG3RtYJD/mHtiGo3w zQUpr+Q+4e75Ye6roi0iLpOY+hjkwh7vq/ApZEcw/IOtdQOldxrhQmB/BDNnm73h0LJs /phoIN3kN7GXSY5ma5EcHF5P43b0X7Oj5dNyQ6tYCiswaGiGn6QoHk5NALuWocD7/bhG VewR3RvgA1NcVnDDWzULcd82cLltUM0qyLVblZl03LlhpO6Kq7uZGPmwZtpvAL/X8Kl/ OQFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=r4wjMbbebvFOxQwlpTJ/d+00q8dKw5DASSdA9l3XQvM=; b=jtFef37ewDN2VWDX+d+itbExPocEn0Tm/wiJ6bqkxGelhbVp6M/OKTw7H+ZcNFZBv0 S60C8wqj4wd5lSHoy/rW3Oc5Fu1fsTNWaxxwHmpWK0iK+aXlBPt1zUL6EE67twU0AYqw H5Ls9yHvFRlZK6aojZhoDXDJLowWxpsNCW3JgKbkoCZ4oUeVcpqb1L/PjGhfvm4PXjPK pjgXEQ2Ou5FKiyaYGhGuthbAcsblZhed5J2x+YNmjCPxY4oWSv6UXoYv684c3oDcnsfs XH7EHTUDaEMJxrc6yvjVFbc2i3WLqPP9NvFRWBaY8v+gtsxrA4ydicpENOI9f8cO57Ys hTZQ== X-Gm-Message-State: ANoB5pnJU8cxT8MYWjwKLLESRLr7HdDnZvMjATtO/4t99SCAkeudpLsD e6RDUKLsvyjWsCvwaJWBpwK19+E4glU1btBIm179j4sh X-Google-Smtp-Source: AA0mqf49XDMG23qXx9h8ZnBGPZuM3g7WYDrKHx5vxwWOqvQr29XfTp996EdLoEkkGcr34+iLiylldV62xxve3H3DREg= X-Received: by 2002:a05:600c:4e12:b0:3cf:d4f7:e70d with SMTP id b18-20020a05600c4e1200b003cfd4f7e70dmr11741485wmq.187.1669278303827; Thu, 24 Nov 2022 00:25:03 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:6000:1d90:0:0:0:0 with HTTP; Thu, 24 Nov 2022 00:25:03 -0800 (PST) Date: Thu, 24 Nov 2022 18:25:03 +1000 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000054bac905ee3324d4" Subject: Remove warning when parsing datetime with + symbol? From: mickmackusa@gmail.com (mickmackusa) --00000000000054bac905ee3324d4 Content-Type: text/plain; charset="UTF-8" Can anyone explain to me why it is desirable/beneficial for the DateTime class to store a warning that trailing characters were ignored while parsing a date/time string with the + symbol in createFromFormat()? Basic example: https://3v4l.org/Sod9o $dt = DateTime::createFromFormat('h:i:A+', '01:31:PM - 03:00:PM'); var_export(DateTime::getLastErrors()); Output: array ( 'warning_count' => 1, 'warnings' => array ( 8 => 'Trailing data', ), 'error_count' => 0, 'errors' => array ( ), ) Docs: https://www.php.net/manual/en/datetimeimmutable.createfromformat.php#:~:text=If%20this%20format,instead I mean, why would I welcome the warning when I explicitly stated that I want to ignore the trailing characters? If there is longer a good reason for the warning, can it be removed from the language? If there is some benefit from having this feedback, then could it be moved to be a new property of the datetime object? To programming purists who hate generating notices and warnings, this probably feels like a wart on the language. Please enlighten me. mickmackusa --00000000000054bac905ee3324d4--