Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96732 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22107 invoked from network); 4 Nov 2016 15:11:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2016 15:11:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.169 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.161.169 mail-yw0-f169.google.com Received: from [209.85.161.169] ([209.85.161.169:35427] helo=mail-yw0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/81-07826-505AC185 for ; Fri, 04 Nov 2016 10:11:03 -0500 Received: by mail-yw0-f169.google.com with SMTP id h14so90087792ywa.2 for ; Fri, 04 Nov 2016 08:11:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CFJ/imUA/ZFDsTojEqYZkCX8YCTLhHjQKrFoe147yYo=; b=dhq/7dWIwNetFq+fq1mBqmRw5tsk9fo9O1cF3c37sRV21TBNCI2QEukrXevGQtdlfS KiIIQSH7ut1gGJBiPC7kY/PLaCOvQcx70Dw+MjPWaVxlnmyqsg1C2U+k4FhCcym6x1KP J9MjRnG91H439v77HiyzaKGK9IiuDZinjCkbe2e3xifDx+KA6Gzi9gKJsuYvyOCIdE5u WH7LBJRwkAAbB/RmMILzUTWbwFmA0JcsampK6Tw0rxeSDEnih2h8bqVd+s5Fts6zQE/T A0Xm8pMBXI2iwXHD1mOB7NX5e82PkIWcfS66n1jUziJmb+np75t2jeouBGU2WLK9W/L2 Fq+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=CFJ/imUA/ZFDsTojEqYZkCX8YCTLhHjQKrFoe147yYo=; b=K3bAZqT8MQObCjYnnstcd46XCX8Zr4jC3SYG5HE0Ow9Q0sldkW3/cORYvimJke1vlo JOVsPo+i22Mez8EHMd0RctSWLXX/f0u6qYPrL71x0FXW9YSuNud+OKUuY0ZqAVeNZZVX zCWWz7akRTzD1VVTBXP7kommiN5oplKA49oVmGkqft2Z9hx6pDpFQN27P9No2NfigeLV LZUl8PrIvO4xFWzOIdFcsFbcpR9aDy9xF4eLmo3FpfjnFjYTJr7DUSZY5bgGCl64GsCf B3tJS6pf2+RMZVQGgtByuxp8AH7VZIPslnxySxzoQkjbRlShWskXlJLuG2TV+7qphvQW lmqA== X-Gm-Message-State: ABUngvcF8fHKJ1yx4N3MBun/pHX0JW8AXjcDSU6IyRE5Wrpd2E3PloNQBdmtbeNxSYgtn2PlSiuNTv3pCS8v+g== X-Received: by 10.13.244.65 with SMTP id d62mr3578371ywf.117.1478272258963; Fri, 04 Nov 2016 08:10:58 -0700 (PDT) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.13.235.81 with HTTP; Fri, 4 Nov 2016 08:10:58 -0700 (PDT) In-Reply-To: <3fcfd89c-12d8-8fa9-eab7-5461771fdb9c@syberisle.net> References: <44244cfd-c8ad-e0a9-4e70-380a8a8c940c@syberisle.net> <3fcfd89c-12d8-8fa9-eab7-5461771fdb9c@syberisle.net> Date: Fri, 4 Nov 2016 09:10:58 -0600 X-Google-Sender-Auth: mL_WkJYyx_cQpshUTr_CjML96II Message-ID: To: David Lundgren Cc: internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Allow Iterator to be used with current, next, reset, key functions From: levim@php.net (Levi Morrison) On Thu, Nov 3, 2016 at 8:52 PM, David Lundgren wrote: > On 11/3/16 2:58 PM, Levi Morrison wrote: >>> I think it would be bad to remove these functions and force users to >>> wrap arrays with ArrayIterator, just to manually iterate an array. After >>> spending a little time looking through how these functions are being >>> used in frameworks and libraries, removing them seems like it will cause >>> more harm than good, even in a future version of the language. >> >> Can you show some examples of frameworks and libraries you found where >> it would cause more harm than good? > > Apologies, that was a subjective statement. I also made it appear that > the usage of these functions was greater than it may really be, and > would cripple said projects, that was not my intention, and most > definitely not the case. > > These are the ones I remember, and another way could be used if > current/next/key were not available for these contexts: > > Yii CMarkdownParser: https://git.io/vXCiy > ZF2 stdlib FastPriorityQueue: https://git.io/vXCiH > Drupal DI Container: https://git.io/vXCPB > Symfony MO file loader: https://git.io/vXCPK > Symfony HttpFoundation Request: https://git.io/vXCXW > > > Dave > -- > David Lundgren > dlundgren@syberisle.net > GPG: 0x26F54D7F > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php Many of these just seem to use `current` to get the first item and would easily migrate to a new API such as `first()`.