Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86770 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43579 invoked from network); 21 Jun 2015 18:58:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jun 2015 18:58:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.220.172 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.220.172 mail-qk0-f172.google.com Received: from [209.85.220.172] ([209.85.220.172:33648] helo=mail-qk0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/B2-29062-E4907855 for ; Sun, 21 Jun 2015 14:58:23 -0400 Received: by qkhu186 with SMTP id u186so90054594qkh.0 for ; Sun, 21 Jun 2015 11:58:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=8BnOcUTAE7bFXnq1HM8j3uAZ+LDyuPLiiAhIHisGWm8=; b=MEIp6vCqEobUp5CoDWoHlpjXjiBSbnWU8/8//15GQq8NUxewHWw0rPZcfjNkySO9Ys X+PrqKaLkJIZsZnIv8HVVF82aM5ct0kuNxh8IJwqaAauHJgweiC9eB68C3kXQb6LEfvK yK9WbdmUosFe2WktphynL/ZNtGIVTj/CrKEoyhi3oQrosl5P0v39xkW9XDrPjkIBu0EC QHb2tqbeoyalkAikkcQuXBYYytyWdBy6hAhy9cgrDnFWec2UvwYj6FCvTR7FcOiB38EK kV5bgSRM3DAarhNqG28HoUfyZkMISt2HL8/LW7jyelgL+xaUlzaCWWQ7wRKM9/sDwbKa OMrQ== X-Gm-Message-State: ALoCoQktBP7V7z5vyi3W5YUtVtbwpc4zEGwXhSNIQhgIHv3tZzEOSid+qCF0dljJ1KyxK2Yr0PPZ X-Received: by 10.140.151.130 with SMTP id 124mr35537349qhx.18.1434913098613; Sun, 21 Jun 2015 11:58:18 -0700 (PDT) Received: from [192.168.100.133] (rrcs-24-136-125-201.nyc.biz.rr.com. [24.136.125.201]) by mx.google.com with ESMTPSA id r88sm9065421qkh.12.2015.06.21.11.58.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jun 2015 11:58:16 -0700 (PDT) Message-ID: <55870947.4060304@lerdorf.com> Date: Sun, 21 Jun 2015 14:58:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Nikita Popov CC: PHP internals References: <5586E5D1.4010901@lerdorf.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Nc6X8JqfUhoT0sGdiHLTTad2je8tW9SDb" Subject: Re: [PHP-DEV] hasType() for internal function parameters? From: rasmus@lerdorf.com (Rasmus Lerdorf) --Nc6X8JqfUhoT0sGdiHLTTad2je8tW9SDb Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/21/2015 02:44 PM, Nikita Popov wrote: > The difference here is that ustrlen() has an argument type specified in= > arginfo, while strlen() triggers an error through > zend_parse_parameters(). We have practically no arginfo-level type > annotations in the standard library. Obviously we can't look into a function to check what it is passing to ZPP, but maybe ZPP could be made smarter and have it fill in the arginfo if it isn't there. That sounds slow though. Or we bite the bullet and fix the arginfo everywhere to make it consistent. It wouldn't be that hard to write a script to generate the bulk of it. I just don't like the fact that a parameter can raise a type error when it claims to not have a type. It makes writing static analysis and other type checking tools much more complicated. -Rasmus --Nc6X8JqfUhoT0sGdiHLTTad2je8tW9SDb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlWHCUcACgkQlxayKTuqOuCVswCfUlcq1szluZJooN4oU2RanPcf fJoAnieQQlCnrFLqgpADvfHUYxFOCehB =pamU -----END PGP SIGNATURE----- --Nc6X8JqfUhoT0sGdiHLTTad2je8tW9SDb--