Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109560 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69916 invoked from network); 8 Apr 2020 08:40:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Apr 2020 08:40:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AA5CF1804C3 for ; Wed, 8 Apr 2020 00:08:54 -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.5 required=5.0 tests=BAYES_05,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS12876 195.154.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from smtp.opensides.be (smtp.opensides.be [195.154.20.141]) by php-smtp4.php.net (Postfix) with ESMTP for ; Wed, 8 Apr 2020 00:08:53 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp.opensides.be (Postfix) with ESMTP id 6F9F44BD092 for ; Wed, 8 Apr 2020 09:08:52 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at opensides.be Received: from smtp.opensides.be ([127.0.0.1]) by localhost (smtp.opensides.be [127.0.0.1]) (amavisd-new, port 10024) with LMTP id eel6q_p7oDsy for ; Wed, 8 Apr 2020 09:08:49 +0200 (CEST) Received: from mcmic-probook.opensides.be (63.120.199.77.rev.sfr.net [77.199.120.63]) by smtp.opensides.be (Postfix) with ESMTPSA id B20674BC5DD for ; Wed, 8 Apr 2020 09:08:49 +0200 (CEST) To: internals@lists.php.net Date: Wed, 08 Apr 2020 09:08:47 +0200 Message-ID: <93315227.iZW88jsf6i@mcmic-probook> Organization: FusionDirectory User-Agent: KMail/5.2.3 (Linux/4.9.0-12-amd64; KDE/5.28.0; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [PHP-DEV] Resurrecting named parameters From: come.chilliet@fusiondirectory.org (=?ISO-8859-1?Q?C=F4me?= Chilliet) Le mardi 7 avril 2020, 14:44:38 CEST Nikita Popov a =E9crit : > The larger problem is that internal functions don't have a well-defined > concept of parameter default value. Parameter defaults are implicit in C > code, and sometimes based on argument count checks. When named parameters > are involved, one generally cannot assume that if a later (optional) > parameter is passed, all earlier (optional) parameters are passed as well. >=20 > While it is possible (but rather challenging) to make things work mostly > transparently with current ZPP, some functions do need to adjusted to > support named parameters, and may cause misbehavior/crashes if they are > not. As a rule of thumb, functions that make non-trivial use of > ZEND_NUM_ARGS() are affected. This is something we can address for > functions in bundled extensions, but may also affect 3rd-party extensions. >=20 > I think that ideally, we'd deal with internal functions the same way we do > for userland functions, by relying on default values that are part of the > function declaration. As part of the PHP stub work, we now have informati= on > on default values in stub files, but this information is currently not > available to the engine. This is a more general problem with internal functions which bugs me a lot. They can behave in a different way when not providing an attribute and when= providing the default value. We should aim to make them behave exactly as a userland function with the s= ame stub, no? =2D-=20 C=F4me Chilliet =46usionDirectory - https://www.fusiondirectory.org