Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99062 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81331 invoked from network); 16 May 2017 22:03:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2017 22:03:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.18 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.18 mout.gmx.net Received: from [212.227.15.18] ([212.227.15.18:60575] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/55-15531-C477B195 for ; Tue, 16 May 2017 18:03:57 -0400 Received: from [192.168.2.102] ([79.243.116.67]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MVN0w-1dUyrd3vNW-00YkV7; Wed, 17 May 2017 00:03:32 +0200 To: Remi Collet , internals@lists.php.net References: <1822acea-b6df-35bf-c760-7d1d06a3d88f@fedoraproject.org> Message-ID: Date: Wed, 17 May 2017 00:03:46 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <1822acea-b6df-35bf-c760-7d1d06a3d88f@fedoraproject.org> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:o1YPOlwwfaWqGpnbZpWXDCOSw0/w5oHEPJOH6BuTsd2BXiQMOkb Db4RwIbMhaPQbbcIw8DBvKiC2m3L+m210SjXaLpiTG7h3JPzFDETj+6yfPHpSh65cGY/iX9 VSRUlphgMjOeCjVScxd/rZgHT8RK/SKyR7SIopDQzxRo4RwFKDvqF5xJ0omxgbFyO7STdif 1N0hhqvxgBEfrm+aspUdQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:TB0/m/5OW6U=:4LajtW/hhPtZL9Y+aBfioi +JvaHFQhstVOf4ivuFp6avbZ1XltMSWoR/r1Cim3dBS7qpsm2szL6clnSggv7JWTHikcvRuBU 3wYrmt4mpzpaXkC6FiKxaQV7aHPdVS7o+5O/u8LUKNVF6puCJt+fx4Rz67fLsePIJx1zkWAhH vP6lDIQPnntG70j11gwtUhQLYgjy8uYkYHgaNWG0qdTCMARtq9PDWak0C2JE/piOYSISqL54B M0zMKRX9PMSfrYf3Fm6FU9NE5Omd08X6EybLtYdC5HFbTQOr0vRnM0KF47c9VJr9uKeXCo3FM Wu1134cJg5jqtB+IrMNYPv6+u1sdk2noOcPeSbBIiZPEwFsQrJj9AaQ19RgpSy7ljNG2F2cmp CIpglR7fCjrLWSQcy1+KllZgmIRlGGxeZ2XrkoXcYTkzHikRTqFbcYUs44E6Vx7JN3rAmgd/E PeAehhy9kpd4x0RckY7Rbo71Km214q73TZqaKPltFi1ZJbBnDU6sM0dmNxYfHYRWc57EOa4Kj 89t6JJuV4ygLMBykRzp6ype4klhrecjcj/guToVom9V2Xzh4lgtZfUACrcNIorDdCb83bbdby xE76K8d9tBBbWpQjJU2s9a+mXXrkxTy3yWNxQdR9POhGCcOMPeis0QiYWs6jNIIp8qKELIw6f HKDnyDzwT0Kqvc62tgXOTduDjC0ROBSavT0VTCd3WK9oRqq2yN/mqOyw2mOkAyu5EdS29LHhY q44jcA+0e6t32lkorBC+Eb54V1TZU4palWSzcoxWSGrpotURCDiYaSvI8QP/SDR6TQJLqlDTp S4o22wM Subject: Re: [PHP-DEV] BC break in master (7.2) - Distinguish betweenunmatched subpatterns and empty matches in preg_*() From: cmbecker69@gmx.de ("Christoph M. Becker") On 15.05.2017 at 17:49, Remi Collet: >> I suggest not to set unmatched subpatterns at all, > > Can you give an example of expected output ? > (I think stable position for matched pattern is important) > > php -r 'var_dump(preg_match("/(a)?([a-z]*)(\d*)/", "123", $matches), > $matches);' See the pcretest results danielklein posted in his last comment on . Basically, instead of assigning NULL as values, the array indexes could be skipped, so that array_key_exists() can be used to determine whether a certain subpattern matched or not. -- Christoph M. Becker