Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111882 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 91291 invoked from network); 17 Sep 2020 14:19:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Sep 2020 14:19:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C1EEA1804B1 for ; Thu, 17 Sep 2020 06:28:07 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 17 Sep 2020 06:28:07 -0700 (PDT) Received: by mail-ej1-f49.google.com with SMTP id r7so3238819ejs.11 for ; Thu, 17 Sep 2020 06:28:07 -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=SEKcwfMO6EMYuup4M+crFxGt7Ehoed2LLRTyMeiZNFY=; b=MhuJ5/pWKTFFvWqtbCo4zt7St5N7lX9LnwgZBb9WeI4/bt6oa8nuANnylewXJXZ8uC vUDTQeHbUPcvBCSqJ0y1dLpXl+mpoyW5YQ8s+8V8v9dbb7yRVaQBMkc82YE/mE2UsMfg z1kIcjhf6+yQ3ojeGF/r991fbcM6pjeODu9jm8lFRShXLtOV8YPzO1LqjS5nWYUjO+dN DuSt+lCPbFKi5zsiD/l+YI7Eqpt3v22j22G3ylzMD4N+hWjmJELvuFJFIAEAcjty04EH ZNgb9QcCPS0px0sPRTlLvJ7AF0bwSjPkOfMzMLot/g9QpIMIBEyiTZC7gfBzqu4frXDK 8G+w== 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=SEKcwfMO6EMYuup4M+crFxGt7Ehoed2LLRTyMeiZNFY=; b=aUN1pIzSHmr3mUGNXcFx9sqKv85+8R17fpPtQsSIG5t5RN+kv4L4bUE07x7EFsNukm G/eF2LLo0YhMKiL1wxxTOXTRloFm6nrW/5xtbObHKNQKKaJacCL+yFWsv8+3hQShcRr7 jEgpQUO0GgOjmGp9EfRmyM0S6LuUIT81WNbiQoOUCDF7K3ZyZQ1RP2+00DAOnUEK/Tom yaXyphMMYIwImywELpMr+nJgVRzPbtuXrm66cDGVEikMMomeuZ5BD7OpsOM/U70neF5m 5f/fyymaNFyjgZqrsbRPe3S5EXXcegl1xUXx5Lx34bIF+eEVYqxUS8TiSPkuqkzuV929 AJNQ== X-Gm-Message-State: AOAM533PgUFhIGFrZSiH82oRbnhKPoztVh6DKRoON/0PAIYp14jhYxLL Qs0u0El1o3rKXguy1pEN1TqHaj/ODCdspwG4JvflPydhsr1LIQ== X-Google-Smtp-Source: ABdhPJze0N5DG1uSxlQGYS5OQS9EleVHYTl5SZ/qaA6CflV8VyQ0NQy/7Wh82RI1zbEFb252m0KzQ2wB/bE1sfPC/tk= X-Received: by 2002:a17:906:358c:: with SMTP id o12mr30082435ejb.406.1600349284607; Thu, 17 Sep 2020 06:28:04 -0700 (PDT) MIME-Version: 1.0 References: <20200917145304.4a6cfe45@mcmic-probook.opensides.be> <20200917152507.1203e8e2@mcmic-probook.opensides.be> In-Reply-To: <20200917152507.1203e8e2@mcmic-probook.opensides.be> Date: Thu, 17 Sep 2020 15:27:53 +0200 Message-ID: To: =?UTF-8?Q?C=C3=B4me_Chilliet?= Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000a02aae05af825a06" Subject: Re: [PHP-DEV] Stubs in ext/ldap From: george.banyard@gmail.com ("G. P. B.") --000000000000a02aae05af825a06 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 17 Sep 2020 at 15:18, C=C3=B4me Chilliet < come.chilliet@fusiondirectory.org> wrote: > Le Thu, 17 Sep 2020 15:03:05 +0200, > "G. P. B." a =C3=A9crit : > > A lot of the documentation is not up to date and will needs to be updat= ed > > after > > there has been a check of the argument names for consistency with other > > extensions in regards to named params, the stubs are the source of trus= t. > > I think a review of ext/ldap is needed then. > https://github.com/php/php-tasks/issues/23 There is a tracker about extensions which needs to have a review still: > > UNKNOWN means that the default value cannot be specified due to some > reason > > mostly the case for arguments passed by references or funcky function > > signature > > implementation which check the number of argument passed to the functio= n. > > > > > I would like to fix those conflicts. > > > Basically my questions are: > > > 1) What is the difference between s and S in zend_parse_parameters an= d > how > > > do > > > they behave for a NULL value? > > > > None in regards to userland as 's' is a char* followed by a size_t ad '= S' > > is a zend_string. > > As for all internal functions which are not nullable they will coerce > null > > to the respective type > > so for a string argument null would become an empty string. > > So in the example of ldap_bind: > if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ss", &link, > &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen) !=3D > SUCCESS) > { RETURN_THROWS(); } > > With ldap_bind($link, NULL), ldap_bind_dn is not NULL but an empty string= ? > Exactly as Tyson also just explained > > 2) What would changing =3D UNKNOWN to =3D NULL impact? > > > > Explicit support for nullable types in the C implementation > > > > > 3) When a function like ldap_bind is called, is calling > ldap_bind($link), > > > and > > > ldap_bind($link, NULL) changing anything else than ZEND_NUM_ARGS? > > > > This relates to point 1 and 2 above, if there is no support for nullabl= e > > types > > passing null can change the meaning of it. > > Then I think most of these needs to be changed to NULL with explicit > support, > as it was most likely what was intended. (the underlying C functions fro= m > libldap accepts NULL). > This should make it very easy then just need to add the '!' specifier to say the argument is nullable and it would set the char* to NULL if I'm not mistaken > Also, there are tests like ldap_sasl_bind_basic.phpt which tests a NULL > parameter. > > What is the dead line for this kind of changes in ext/ldap regarding to > PHP-8? > As we added another beta version before RC you have at least another week and a half for sure. However, I expect getting rid of UNKNOWN values can also be done in an RC release whereas naming should probably be fixed before RC1 comes out. > C=C3=B4me > George P. Banyard --000000000000a02aae05af825a06--