Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:105974
Return-Path: <nikita.ppv@gmail.com>
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 35276 invoked from network); 18 Jun 2019 20:39:37 -0000
Received: from unknown (HELO mail-lj1-f179.google.com) (209.85.208.179)
  by pb1.pair.com with SMTP; 18 Jun 2019 20:39:37 -0000
Received: by mail-lj1-f179.google.com with SMTP id p17so477187ljg.1
        for <internals@lists.php.net>; Tue, 18 Jun 2019 10:54:04 -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=CAt1yP4sBLVgSlV77bPSRBVc31Ozy9rSmkZnY9Lpia8=;
        b=CQf4AU9VGFkbhkTly9ep2nfHyYAZVdMVfbb/6AfuYSAJDZq+BcbWlbhv3ig69+UxoY
         af2HIJC5yOgiNpPRPHALPobE3MjS9fvqWMKtw0v1yVwvfzqXqIpxpLdKB4xbnC37KR3F
         FfTNHpeOVvThZ9BYdkdp4/vRgK5eDBmEaVfqHPLHCq27G5S9dsdV6WmMWxCJ+nGbjmey
         QO/TptERjG8EFNM1EQbyoRctvvbkDc/4/x6wc3YP1DkoLL+iPa0fLMj8jw/51Rbdxxp1
         6INSHkNpBcSlFWkIRslJslZ0sLMuXMbaTWgQNXXrjGQjdU6sVf51s86qfb2tGO5q2Zv3
         i4cA==
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=CAt1yP4sBLVgSlV77bPSRBVc31Ozy9rSmkZnY9Lpia8=;
        b=Z79KH924+zatA09SSZ/0znuTUVpnEzRoL0xMk1QaiQnz1uub5lxsFchovEzTu3ITZb
         CYz8laKzhZtedwHhfRjgwRSyqlHtwnsgqlhlCNTMclN7ssWrQf2G4JDswcv9YXhR/THh
         HpIUd87RwEktidsZxb3VNfUShdzgK0Rxo8OPSQDsp5lXN7EW1rJBuRZAFtTzSDAdvItH
         PEkpRMc0GQEHXAJy3KUm5j85bTu8ZF1BGF3F6OePiXLpuOKFV5Gu1WAzsqk3O6WC+6lP
         d8A7Yq0zn+SsvrS/qJJ3Ds2Wup2SVO/Cb7Iy7bLXg5CVvuWBmkcOITwCCThEryXyGqRk
         fcDA==
X-Gm-Message-State: APjAAAXGIbqNJJ5iKJkJYrwWHY8Mw5wNzXDYOmi5b2gPvTajF/ixR5t0
	n6MU93R2TitQ6n458p1s3gNCHk7Vs6iEwNZrG+o=
X-Google-Smtp-Source: APXvYqygI1bNu80yd2TlBtjlseS2GFUT9My/aeC8gv35MJJIDDQSuvJXbgkOmLwZm2JDRNZZXZemT46BWuAzQjkEXKY=
X-Received: by 2002:a2e:3e01:: with SMTP id l1mr48534182lja.208.1560880444120;
 Tue, 18 Jun 2019 10:54:04 -0700 (PDT)
MIME-Version: 1.0
References: <CAF+90c__85rwDJ49K5=-wNV_SbSwm7z+VuKPU4Jmkuuqg5mySw@mail.gmail.com>
 <CALKiJKoWX1AOVpGfyRG85Enzf2KhQty4RRXP=WKk90PBwcLviQ@mail.gmail.com>
In-Reply-To: <CALKiJKoWX1AOVpGfyRG85Enzf2KhQty4RRXP=WKk90PBwcLviQ@mail.gmail.com>
Date: Tue, 18 Jun 2019 19:53:48 +0200
Message-ID: <CAF+90c-eneLAym+qLvp-ZYbnxWopT2PQGWOENdQWMjcgJO+XYQ@mail.gmail.com>
To: Rowan Collins <rowan.collins@gmail.com>
Cc: PHP internals <internals@lists.php.net>
Content-Type: multipart/alternative; boundary="00000000000068a2db058b9ccc68"
Subject: Re: [PHP-DEV] Generating arginfo from stub files
From: nikita.ppv@gmail.com (Nikita Popov)

--00000000000068a2db058b9ccc68
Content-Type: text/plain; charset="UTF-8"

On Tue, Jun 18, 2019 at 7:38 PM Rowan Collins <rowan.collins@gmail.com>
wrote:

> Hi Nikita,
>
> On Tue, 18 Jun 2019 at 16:10, Nikita Popov <nikita.ppv@gmail.com> wrote:
>
>> I've created a proof of concept implementation for this at
>> https://github.com/php/php-src/pull/4284. Function signatures are
>> specified
>> 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.
>>
>
>
> I notice on the PR there was discussion of stubs elsewhere (e.g.
> https://github.com/JetBrains/phpstorm-stubs) still being necessary
> because they contain additional documentation. However, has the opposite
> been considered: process an existing set of stubs to remove unsupported or
> irrelevant annotations, and import into php-src with this tool? That way,
> the manual effort for existing functions would be virtually zero.
>

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.

Nikita

--00000000000068a2db058b9ccc68--