Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106287 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 1555 invoked from network); 24 Jul 2019 21:56:10 -0000 Received: from unknown (HELO mout.gmx.net) (212.227.17.22) by pb1.pair.com with SMTP; 24 Jul 2019 21:56:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1563995977; bh=oCasKuKhVk51ukaU4/Et1KHYnF+pk5lT6++bOHb4seM=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=lY+GwZ8vpF/u8oHxD4by0llzQAdlMEPd6rOUOPWFyGKormGQ9qtlw2XHSh8C9T+Eg uRLlA4qeNwtRzfQhG0VZiJoraTnqPLGT9uPwMDhZ5IAXKwt/LAasyPDZf1H+SWaF9w lzbqaXAzGTwndXnYN3BTvciXIUneTdo9Zp/or57c= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.144] ([84.179.231.50]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MJFBe-1hohpz0X2A-002oGX; Wed, 24 Jul 2019 21:19:37 +0200 To: Nikita Popov , PHP internals References: Message-ID: Date: Wed, 24 Jul 2019 21:19:36 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:6lpPrJr1zr6RvnXxOIeJ2AGumg32gSFle4MBkskvP+QC/Q2EUGV bIzihWp8YV2M6ZeOkoaJxpC16euGFO7l5ixPzZvP1/+fKs4nGEU+cR/1ip+XJANMkGoh6Dt 3fOnjm6QI4XFwofcB4XI2tAkUkhJXFyzyigOo+LHqJVjimfBs9YztVt339U79M2ZNxLLjeR IiHWSemkRr00RKMzhYlyA== X-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NB9Si/3cnm2yJP3OQDV VaFeRyUwrpmwMe0u3e9+H5og4MWOt7kHn/io75BxnJ3eAz9e/bkOo43+WLHew0nh5KS0/Ej+4 FvmStzwfQIeaCgkncLN87cCgS0NNLdQjd15 Subject: Re: Generating arginfo from stub files From: cmbecker69@gmx.de ("Christoph M. Becker") On 18.06.2019 at 17:10, Nikita Popov wrote: > Hi internals, > > In PHP 8 it will be possible to add reflectible argument and return type > information for internal functions (it was previously theoretically > possible as well, but forbidden by policy for php-src for multiple reaso= ns, > which have now been resolved). > > It will take quite a bit of effort to add this information for hundreds = of > builtin functions. I would like to take this chance to improve the way i= n > which arginfo structures are specified, and make it more ergonomic and > future proof. Here is an example of a typed arginfo structure: > > ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_alias, 0, 2, > _IS_BOOL, 0) > ZEND_ARG_TYPE_INFO(0, user_class_name, IS_STRING, 0) > ZEND_ARG_TYPE_INFO(0, alias_name, IS_STRING, 0) > ZEND_ARG_TYPE_INFO(0, autoload, _IS_BOOL, 0) > ZEND_END_ARG_INFO() > > Rather than writing this out by hand, I would like arginfo structures to= be > generated from PHP stub files that contain definitions like this: > > function class_alias(string $user_class_name, string $alias_name, bool > $autoload =3D true): bool {} > > I've created a proof of concept implementation for this at > https://github.com/php/php-src/pull/4284. Function signatures are specif= ied > in a xyz.stub.php file from which xyz_arginfo.h is generated. This file = can > then be included in the implementation. Nothing about the arginfo > implementation itself changes. > > What do you think about providing this mechanism? I like it. Thanks! Christoph