Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105978 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60708 invoked from network); 18 Jun 2019 22:56:31 -0000 Received: from unknown (HELO mail-ua1-f49.google.com) (209.85.222.49) by pb1.pair.com with SMTP; 18 Jun 2019 22:56:31 -0000 Received: by mail-ua1-f49.google.com with SMTP id z13so7350084uaa.4 for ; Tue, 18 Jun 2019 13:10:59 -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=yDHDszATDLWlnV2Wv+Dcv5iMSWDajtzMxytuCK9wrjk=; b=bwPluiPAQexWgnEs3onxdreQHR16sGoAeqHvwxe5GtK5sncp0pSouXbuk+s43hVnrW JE57Wm6VwIg2dEiLcZ3xpzQLqTHGnXzKutbIcdzDDjjNjeuVrDERWv1Z4FrYXwgD3ZZ6 SGIiN4BSviJWbeDfpBzrqgBlaRJOwNpJY6gJvAhlI01rT3rc/X+WJHXbP3i1Ubww1YhE OhutN1pXDBb7Ewu4ChFGuj97HIp9b/hn+je4QYJGebDwqxtPcj7al6ULkmhuGDdWtRmA j92o0DkQ37+L0BHFnGHlf2frRhT1BjOFhnB75hUiASstjbuJLN7zRhq3eg0QTlMtK7Ek ZWTA== 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=yDHDszATDLWlnV2Wv+Dcv5iMSWDajtzMxytuCK9wrjk=; b=rPEsOHRxN78SisVaAU30D1FO1uJzyPGFlrCvejSwKtRdp6Fi4Bma8brpVa8UXdZ4Sr pMtif93f8ysJt50L6EFUMlyICRlTCMOPy+7ZVK1Uy+/Qc8KPJLCZXpRtb3Diu0deEhDK kx1v6L1SNpTF6UyxOg2nOD1SfUNFpIu8iKJLynRDXA0/cw6FIXSQVntAg3+bw8JRsH6I Ql/O6Nx4oXSi+4dYg8P5zV41FlUdmGVeb0qH7I3EYX2pgtcUJKmJ9A6jMb106GjQlo+U 8BP9m6W1pDtBdHZ6Dovilo7ngWhpB48oT5hDmi8KhT1vHyCOdT2gfM6GqoMF79vMRAXO cUTg== X-Gm-Message-State: APjAAAVcFxjVuWRDKPBY+rlE6rG+RzMvgsrSRDKybPOiz2lA5oJ5w7Ea SUs0Cv74HzqEdL5x8IzKCF4xzvtPrZ76slOpM5Q= X-Google-Smtp-Source: APXvYqxiQFZxEkKax01zmy1209DpSa+3nti3okYfIEdl9oNPGsJxWoAgGG7kVSTuDz5JglBfFOsVOGQlngZ+Ga4gKHI= X-Received: by 2002:a67:fb18:: with SMTP id d24mr40567307vsr.59.1560888659508; Tue, 18 Jun 2019 13:10:59 -0700 (PDT) MIME-Version: 1.0 References: <5d092f7e.1c69fb81.72707.a7aeSMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: <5d092f7e.1c69fb81.72707.a7aeSMTPIN_ADDED_MISSING@mx.google.com> Date: Tue, 18 Jun 2019 22:08:41 +0200 Message-ID: To: Mark Randall Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000158513058b9eb6e7" Subject: Re: [PHP-DEV] Generating arginfo from stub files From: george.banyard@gmail.com ("G. P. B.") --000000000000158513058b9eb6e7 Content-Type: text/plain; charset="UTF-8" On Tue, 18 Jun 2019 at 20:37, Mark Randall wrote: > On 18/06/2019 18:53, Nikita Popov wrote: > > This is not really possible, because we need completely accurate type > > information. phpstorm-stubs is a good approximation especially when it > > comes to "useful" return types, but it doesn't model things like possible > > "false" return values with sufficient accuracy. Any type information we > add > > in php-src needs a careful review against the implementation. > > I say this with a certain amount of ignorance, but what about the > existing manual? > > As the authoritative source of user-facing documentation, does it not > contain an XML parseable signature for every method, in addition to a > return value section detailing types and a standard boilerplate for > things with falseable return values? > > The main issue I would see is "mixed" argument types in the signature > which would require manual intervention. > > I'd certainly like to see a more comprehensive format. Stubs are great > but stubs seem more like the end result rather than the original metadata. > > An XML or JSON file capable of expressing the names, types, defaults etc > would have the added benefit of being easily extensible to cover things > like descriptions or unions with different requirements for each type. > > Well-docblock'd stubs, C definitions, documentation pages etc would then > be the drawn from the JSON rather than the other way. > > -- > Mark Randall > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php Sadly this wouldn't be easy to pull off as the documented return values don't include any error return value such as false or null; and even some times the parameter values aren't in accordance as seen with the null documented default values which can at times provoke an invalid param error. A good idea which can't work :( Best regards George P. Banyard --000000000000158513058b9eb6e7--