Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105998 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99140 invoked from network); 20 Jun 2019 14:56:36 -0000 Received: from unknown (HELO mail-qt1-f171.google.com) (209.85.160.171) by pb1.pair.com with SMTP; 20 Jun 2019 14:56:36 -0000 Received: by mail-qt1-f171.google.com with SMTP id h21so2884502qtn.13 for ; Thu, 20 Jun 2019 05:11:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gI4gJMW3/YYScgmjn3xXBBrWn4K6jM1XJplbjHsKWiQ=; b=VRN+js1sSqlDrwSzLi48dl1WyxPVjd+cKDZev6zQ8JttWDnipfgmfXB8Ia/v1Eiq7x iWLYU3xn21zfxvlRAsdYmX64F2OntbW+GknxNZfvUsnLM75q7+YcP0s1nvUp5X2ia6+G ZT3abkuvKeVYxQY2fk0jxFvPlLZRLNPML78QZ2hiUlAJAtXbAAx2YFSmyeC6VnuJNN97 0WKi3zmrfCLQwkHWZRvtRv92CaKxy4T9LcUKEr5TB76hrNpXFP8I99Sbeg1aOoaUcSF1 uKUvItmd25+xw06YIelv/SfQLnhv8yVzZ1+7TdHBTFTTwPNQBIo/TMDugMUR2yy7uG1H Gyag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gI4gJMW3/YYScgmjn3xXBBrWn4K6jM1XJplbjHsKWiQ=; b=PCmh5SlE+bbbmV3LrN2Cmg7xerRiesiz6u26zoKWIADzQqmUrfxBBlEU/KSzH5NR7z qymG4RcDgAtBzfF+SXxnBvD5ROcSWbYvUjpYoNfwbjeU+2ybVH9WTVqwA4vSd22Hy909 6M53sBqkFKA61eibtkHgUV4W8kiV7xXLEUxW1+AavJmhChn5siT4f0eUqYClY0QFQJVE HNqtDeBuo+7tB7ma8prw97bdgrWfyWwslu3ee81rt86lIn6+3f0Jzi6lKoRDffqiGcTU imTxCjsMaankxHH8f/qPqjzfnOwGwnyXEPpkdJ7Ku0HtQ0y9XslqqnzfhU39I4Uw6lWL b/Jw== X-Gm-Message-State: APjAAAXdb8Y7woKxU3HiO/t1bZG6wpy57WZtIGAZ95tkq+0C0IVX/Z3u uZ4ETpNEgFSk3TxxjBPfvKBQjr5drktUAlJpzjw= X-Google-Smtp-Source: APXvYqzy02rStGw5KxsJlKNlsQNKHRBOY36yzbvASEbv5wBaT/ldv2Ecqh+n2fSlieykYJvABmzBNq5siyJk0HVhEZM= X-Received: by 2002:a0c:ed31:: with SMTP id u17mr38611392qvq.107.1561032687791; Thu, 20 Jun 2019 05:11:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 20 Jun 2019 14:11:17 +0200 Message-ID: To: Niklas Keller Cc: Nikita Popov , PHP Internals Content-Type: multipart/alternative; boundary="000000000000d6b436058bc03e05" Subject: Re: [PHP-DEV][RFC] Normalize array's "auto-increment" value on copy on write From: netmo.php@gmail.com (Wes) --000000000000d6b436058bc03e05 Content-Type: text/plain; charset="UTF-8" I left that out of scope for the RFC, for reasons I don't have the knowledge to describe properly. In the following example, `unset()` should reset the auto increment to `1` only after the third `unset()` call ``` $array = [0, 1, 2, 3]; // auto increment is 4 because there are "holes" in the index unset($array[1]); // auto increment is still 4 unset($array[2]); // auto increment is still 4 unset($array[3]); // auto increment is 1, because the index sequence is contiguous, without holes ``` I would love if it worked that way, but that must be covered separately by someone that knows how to implement it efficiently. For now, my RFC only makes sure that foreign references in particular will receive arrays with normalized and predictable "auto increment" values. Wes --000000000000d6b436058bc03e05--