Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119790 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 58680 invoked from network); 30 Mar 2023 13:55:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Mar 2023 13:55:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C6DA01804F8 for ; Thu, 30 Mar 2023 06:55:49 -0700 (PDT) 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.0 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (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, 30 Mar 2023 06:55:49 -0700 (PDT) Received: by mail-yb1-f180.google.com with SMTP id r187so23552834ybr.6 for ; Thu, 30 Mar 2023 06:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680184548; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=a32Qfxv+tH+gPEGYPqeWGjR4ZdMgcuQl2SQ45UeMuyw=; b=oqKyVBXacP5fp+5wSb1mxH/rDVgWCLiD8gPTD/RMtqDQFqKehF1PQL6ML579SBvpj8 oL8bhWelSc9Wl8bHV4iDU10dDW40fj28kCVAANk2lBZ7IOsXufJfZ6MT8hC7KV9GlZYH EQiq/ER0qz17G4ci/f083JVXUcfCqmzJV4k4jwb1MgBGmFmjjiqVMv8asB5Msxpr1kVE sosCoovZx4O+hXBMn5YpETijpFzApAXeShj2EEWx+qxNiqFOwms5eHq6b9Qjj2yrc3QN Q4iup/52TOd3S/oUiFPIHHMafLsG7svyLlLhpywOn4rZHXmam0kYFHt+PoJZJiNlIe18 NPHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680184548; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=a32Qfxv+tH+gPEGYPqeWGjR4ZdMgcuQl2SQ45UeMuyw=; b=qGMMXZtx8tpF8bXjQgd26ltCQP08l9Cbk5j2xpJAvv4VKfWSZy/ou9h3BgCl63RpQv +7BiiLlavGKSGURrRWW7SNbS3+Agrk65STZwCsCtYGG4ADPKLunzLaxsU4OE32EWHx8j AgOWtFncVZMiTVtiWlc6dsjxNDOUvPrZXBwZx5M2mB39cjOmUFxjsM6WmzSegNa+Hx+6 v4T57a6oaifOxRl9eJqnYI3SmoJuZbciHIO644nxqzv2YUY8Ll/tfw7QM1jcAV7w1ojj r/NLDYgiMe6wl3Fvmij6w5soKK1gnhDU6oGyu9I/JUUM5sOj/LvIzv3dWDVTFz2wLGqp zIrQ== X-Gm-Message-State: AAQBX9ffLpQJDJ0b+jz2p2TG4VQHaGU8q3yem9n4gAq2t1nMiUWMMrpO 0GWfQHmxQ/YZZLQuBxpGG+MV99U3oyNE3hQKEq4= X-Google-Smtp-Source: AKy350YPo7QpRCPlRGKBvYdI5hN2lc0jKtH1hdgFDc55wXZR9CAr28nKBWs3m2MtoUe8F/GsEBvFrhS0cXg78Q7+D8M= X-Received: by 2002:a05:6902:1586:b0:98e:6280:74ca with SMTP id k6-20020a056902158600b0098e628074camr15246115ybu.1.1680184548373; Thu, 30 Mar 2023 06:55:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 30 Mar 2023 13:55:37 +0000 Message-ID: To: "G. P. B." Cc: Mark Baker , internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000029b6f805f81e73c0" Subject: Re: [PHP-DEV] [RFC] Define proper semantics for range() function From: tekiela246@gmail.com (Kamil Tekiela) --00000000000029b6f805f81e73c0 Content-Type: text/plain; charset="UTF-8" > > I've changed the behaviour to throw a ValueError if a negative step is > provided with increasing range and accept negative steps for decreasing > ranges. > I am not sure this is better. This would introduce a BC break because now it's not as easy to avoid the error as you can't just wrap the variable in abs() call. I am not sure why we are even treating this as an error. It looks to me like PHP already copes with this whether it's a positive or negative number. If we just want to inform the user that the sign has no meaning, we can raise a Notice and leave it at that. It's not wrong that the step is negative, it's just a pointless sign. --00000000000029b6f805f81e73c0--