Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106704 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49337 invoked from network); 26 Aug 2019 15:39:16 -0000 Received: from unknown (HELO mail-lf1-f43.google.com) (209.85.167.43) by pb1.pair.com with SMTP; 26 Aug 2019 15:39:16 -0000 Received: by mail-lf1-f43.google.com with SMTP id v16so12189466lfg.11 for ; Mon, 26 Aug 2019 06:10:55 -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; bh=GvK1/YvmUWTyr8SwLfRc5pswr7pmGpmakXAc/tEIsYE=; b=eKdELD4ECrWv3c/hvEKX6CIagDvOgaDXgOdx6VR5qzix/Iwp4CAQ72KM3eRl0obCkx LXdPKSiQXxLs1R2X6NB5fPDowFqrRXMhj+RhyiF6Lmt4kAxNqcTw/U7NplScdHZI4Bjh oyBvqV+agS2rnsvLGKE1XLnZkZixe4sI3h/fjX6NjlTP3uSQZnyPHgNYtAesd0+ZdgYJ BEu9PWzKsUpgSvXzP/7fKzyARYRO+w1RcEMv5vO1isl1y6qoF09/En9Yw/eW3fPlUfqW i6QvrPlSR4kZnw6n9U3Tkvgf4HvCb3sUVs7fNI+eKbzkkqNas0F7seafNxX3C2UM30q/ xjvg== 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; bh=GvK1/YvmUWTyr8SwLfRc5pswr7pmGpmakXAc/tEIsYE=; b=BYU5SLPx0Kky3/kQif8TwKog5et0FLnqc3vkpnjgQLFk8RU1hNi86FoqSbYV6u74ks HEdI/FWBdRlqVCfzzaIfYcDW/7hYrwdxc+B8IR8C0JHuNUYP5jeZDDKagCeIYLrJqZTW 2Mzz9sYphRxzSMsBZDLHx2KUTzQe8O2GyG64tRedzCXGLQG/mN8qZ7vWtle6j8sgN9nv U/t0CuvFZvYneXNrOH+brL+cfsNP54lKdu5nte1Lcq2C+qtvL6aUcW6WrXUwRy5J2Fbg TeizENploJiVis6pUhH1GLUIZIFG05bHadpgXDJ2MpS3VZyst5VWJEf4VOhj7IHENMLr eTnQ== X-Gm-Message-State: APjAAAV3IxbZwl2pLaZ7TPaYsPGV8Yye5fH2j+GFvOGsP15uMSqgEvHC hAVyuJh8DbKJO6tRLiBNMSETbSPU2s+o4iNr1lrbQ8Q5 X-Google-Smtp-Source: APXvYqyif6qB3nORHbkFX0TUdkmQpIR48Jxu1fsi5W5EhS13aIcYTJ0hMDGQ+x1SEQwy6iq9cFPXmk/vfKVXIU04ulM= X-Received: by 2002:ac2:44cb:: with SMTP id d11mr10249605lfm.59.1566825054128; Mon, 26 Aug 2019 06:10:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 26 Aug 2019 15:10:37 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000c6cd45059104e227" Subject: Re: Call for participation: Annotating internal function argument and return types From: nikita.ppv@gmail.com (Nikita Popov) --000000000000c6cd45059104e227 Content-Type: text/plain; charset="UTF-8" On Sat, Aug 10, 2019 at 12:56 PM Nikita Popov wrote: > 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 > Thanks everyone for your help with this project! I think at this point we have about half of the extensions covered, here's a hopefully up to date list of the extensions that are done and those that are still missing stubs: Complete: ext/bcmath ext/bz2 ext/calendar ext/com_dotnet ext/ctype ext/curl ext/date ext/enchant ext/filter ext/ftp ext/gd ext/gettext ext/gmp ext/iconv ext/json ext/openssl ext/pcre ext/posix ext/readline ext/shmop ext/sqlite3 ext/sysvmsg ext/sysvsem ext/sysvshm ext/tokenizer ext/zip ext/zlib Pending PRs: ext/exif ext/fileinfo ext/ldap ext/session ext/simplexml Incomplete: ext/standard Missing: ext/dba ext/dom ext/ffi ext/hash ext/imap ext/intl ext/libxml ext/mbstring ext/mysqli ext/mysqlnd ext/oci8 ext/odbc ext/opcache ext/pcntl ext/pdo ext/pdo_* ext/pgsql ext/phar ext/pspell ext/reflection ext/snmp ext/soap ext/sockets ext/sodium ext/spl ext/tidy ext/xml ext/xmlreader ext/xmlrpc ext/xmlwriter ext/xsl Regards, Nikita --000000000000c6cd45059104e227--