Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106522 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48571 invoked from network); 10 Aug 2019 13:28:56 -0000 Received: from unknown (HELO mail-lf1-f46.google.com) (209.85.167.46) by pb1.pair.com with SMTP; 10 Aug 2019 13:28:56 -0000 Received: by mail-lf1-f46.google.com with SMTP id n19so2907888lfe.13 for ; Sat, 10 Aug 2019 03:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=YDp51C7KplxCE+V/TF9+/Ksw1+8hlxNEoGYPK4uwF5k=; b=Xg50bWLN2ZdfThnIISamCCL0ewlrrvB3EK+lNBF170J7KmS/0lWOYlvwQnccRcOJH2 82ut7A4pyGX3aTjuiAQAqQk2bF1SyqGURKafRrPjqzqVKfPUKf59V9TfonOFNAsZ/X5O lmoGM4+4KU3Ak2GMocF7vuPIvwslLmZxZ7ZbqDkTu8JGaDbwj+f5Uosmc6wvUPqIW0Pl 9tjuFUtLfdYo1iiOy5jdnY6xaka6dlhOKh3Kne2JYYSWb3TNBJtxdN7EStxzy0LgJ/bU HhtkX9a5sed5XXiecN+Y4Nhok3YcHYQthn14YNecDo7yH6aHaGAUgrnxC7V4UaGXLGam I4MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=YDp51C7KplxCE+V/TF9+/Ksw1+8hlxNEoGYPK4uwF5k=; b=HBw5yAk/tIkDbJYI1gU/Xb+U6WQxRUfi+Eg0+Mk1c8f9el5w4p9sQ/q3nxI3Vvvbxc CSu5kdaD6v0pyhy90w90fupFmGztmJAkgFal0djW7md6CBwNjN8fXI5l3V9GozZrciXr qOOhrs7boKyyupw8dQisAWb4u28ljxZva/Mq7XR/xJxQ36QM8mZep7emzACwlPhx6VUT vJb1Ws8OVFpuTOUJTs0UAWn+iG6CpXWw9XQ54ZIESgtT4SaB4wVd73jheJUevD1LtH3z 9R9MBBVNF9ur4sj1u5TCfT1842aSUAo/X3YaduPNlFowdKGTRtvnYdEUjDhHp5w2tyko tw1w== X-Gm-Message-State: APjAAAUqL8CmFdCVtabh7bVuQ/Wi+3Y3t5krjLt46LPys+hywBSWgNiX 0Rbg5CBNcvyFmwsGBoJPalFjsba7ieq1RVLg49I5rcRQOe8Sgg== X-Google-Smtp-Source: APXvYqxXDp1zy7dtdFjehuiYdTg26klnaGQj7QM65tBk2DdwgbLk2juGiWnI6h0yMwi6UPUOhaT/9htcW76QnMCkydg= X-Received: by 2002:a19:4c57:: with SMTP id z84mr505444lfa.87.1565434592790; Sat, 10 Aug 2019 03:56:32 -0700 (PDT) MIME-Version: 1.0 Date: Sat, 10 Aug 2019 12:56:16 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000d28ce6058fc12433" Subject: Call for participation: Annotating internal function argument and return types From: nikita.ppv@gmail.com (Nikita Popov) --000000000000d28ce6058fc12433 Content-Type: text/plain; charset="UTF-8" Hi, Lack of type information for internal functions in Reflection is a long-standing issue. In PHP 8 we finally have all the necessary technical groundwork done to support argument and return type annotations on internal functions at scale. The only thing left is to actually add those type annotations ... to many hundreds of functions. This is something everyone can help with, as it does not need expertise in C. I've opened a sample PR to show the process: https://github.com/php/php-src/pull/4499 Here, we take some existing arginfo structures in basic_functions.c and convert them into stubs in basic_functions.stub.php. We can take the argument names from the existing arginfo. To figure out the types, we need to look at the implementation (the php.net documentation tends to lie about details). For example, the first function, set_time_limit is defined in https://github.com/php/php-src/blob/172c71980df0fe4c9d62c3365f0a2cdb139e3e86/main/main.c#L1501. We see that it accepts an "l" parameter, which is an int. We see that it uses RETVAL_TRUE and RETVAL_FALSE, which means the return value is a bool. Once this is done, we need to auto-generate new arginfo data. If you have a development setup, this is done automatically when running "make". Otherwise, it's possible to manually run "php scripts/dev/gen_stub.php ext/standard/basic_functions.stub.php". Any help would be appreciated :) Regards, Nikita --000000000000d28ce6058fc12433--