Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106705 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 74979 invoked from network); 26 Aug 2019 18:31:07 -0000 Received: from unknown (HELO out5-smtp.messagingengine.com) (66.111.4.29) by pb1.pair.com with SMTP; 26 Aug 2019 18:31:07 -0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id E2BC122028 for ; Mon, 26 Aug 2019 12:02:47 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute3.internal (MEProxy); Mon, 26 Aug 2019 12:02:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= ryanmccullagh.com; h=mime-version:message-id:in-reply-to :references:date:from:to:subject:content-type; s=fm1; bh=6mkasKy KKUOI8snQBg8/ubkGbbdPo9g5OqMhWeGJTGY=; b=NdHJMCZV8V5p2aLnyQ+gXjZ VcNU/AhoQV7KnIvviKNyz94GbPqc/+npPjU+Nc2Um5Hwzovw1HksdlwKDltLTQBG a8fmDSGroy0+We+5ofJAjHiGBU9HlzaDB1qLbLe627oBP6mxsft6PIgTk+tGK76H 9ByAtOjgrkImevjnJjbb16H5IOYPLAtbc3YTyu5OHLiE2RBJfd5uOx7jg8AAtSyW xPHaB1aarC3dbx3d2qQkrcIdBRrt9JchvMTz0LWl3yOZS42KZc/983kQhwRSEUp9 tIE2+OG3xcugLV8F/QtPBLS4iRq1IJvUwjRuujrLbXK0SktnfFME0+YgI2cAA/w= = DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=6mkasK yKKUOI8snQBg8/ubkGbbdPo9g5OqMhWeGJTGY=; b=BcPXyFbknNjrJoqQrJp8my hN7r0VnvZ3hqsSEA7Jp95nwu7AwcGelbp4riNSATNvYvH2dmSHspMge0zixXZVt5 0Y/G79cJOGAmFJR1T6i49BjPrxv84UbuImGwDrpOcJ/AOZyQVFIDd2ZSK8Y/nAgU n2RdvzVuYEohaCUZGFsVNqA/6/Yeiw0rzzghhclOgr8oGTNj9SOT9/de3qUheum9 MlLJTKUvQGxxCt8IJtM8XoL2QoOOq2sAPh4kFF7bgRP0SsTiDhKqxXFxNbK76ZOP WaOLL/yL39lbq04nrLFG+E0BHbbqknyB6TKnzytPx1witKREPmwudzuaYpqs4+ug == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudehgedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepfdfthigr nhcuofgtvehulhhlrghghhdfuceomhgvsehrhigrnhhmtggtuhhllhgrghhhrdgtohhmqe enucffohhmrghinhepghhithhhuhgsrdgtohhmpdhphhhprdhnvghtnecurfgrrhgrmhep mhgrihhlfhhrohhmpehmvgesrhihrghnmhgttghulhhlrghghhdrtghomhenucevlhhush htvghrufhiiigvpedt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 44E9BE00A3; Mon, 26 Aug 2019 12:02:47 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-916-g49fca03-fmstable-20190821v7 Mime-Version: 1.0 Message-ID: <98bc53a8-8283-4b70-be76-908574bd3061@www.fastmail.com> In-Reply-To: References: Date: Mon, 26 Aug 2019 11:02:27 -0500 To: "PHP internals" Content-Type: text/plain Subject: =?UTF-8?Q?Re:_[PHP-DEV]_Re:_Call_for_participation:_Annotating_internal_?= =?UTF-8?Q?function_argument_and_return_types?= From: me@ryanmccullagh.com ("Ryan McCullagh") I would be happy to help annotate the functions from the extensions in the Missing list. One question. Should we be using the documentation as the source of truth for parameter types, and return values? On Mon, Aug 26, 2019, at 8:11 AM, Nikita Popov wrote: > 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 >