Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98915 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65202 invoked from network); 29 Apr 2017 21:06:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2017 21:06:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 74.125.82.53 mail-wm0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:38833] helo=mail-wm0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/9A-01540-86005095 for ; Sat, 29 Apr 2017 17:06:48 -0400 Received: by mail-wm0-f53.google.com with SMTP id r190so73007027wme.1 for ; Sat, 29 Apr 2017 14:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=7J9BzE+A0aiTQJJDCoDy/ahyzrMRCv8iM2193Mb0D+M=; b=OlXLkASm4TZja/q51CAGOKNtAa467av4XqJUaB1CaKLVAE8AqrsXAkkKxKP186reCi 4eCtSeZJ/ZJLC8kSnnA4QHzx5OXcqyaAg7B/v+U5a/vWL00Fc8tcG81oDRAYxo2VJ6wx 0X9+JFOZ1ES3FMOqNkdKjqCLMzFhy4Ma137Rbs7BpE7ytHIfhBThbZ/Ybw2Mb+3nen9s vgw14j6ZeHTaW47trnsP4gVK8h8ienA+hTt7yIXglfXV5ckrNiAQG3Aj/1AhrHWvFO7/ UGsZzSa9tuKNSn08qYCT59ALDstNzQKdU0LD/Ykgc0ekN//iqmfMwZwU8+JObrGJ3hSc pE2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=7J9BzE+A0aiTQJJDCoDy/ahyzrMRCv8iM2193Mb0D+M=; b=Yn0X36wNkENUY8SkwQwiLXnZDbI4fy3WJjbQN8Qrv6pAsMG/xhOr10n/cF4U7t3dlK /VvAYDkOza0YOUDWFMddZAT1Ar0efn07NHcl8UWorWtwz4NKOrfpAcMD9Q8n0WhFEFp1 3/SCrHoNfzezPOlQWfEZa0N+FOqdnAPlOezU+PLVM6HT8V9pPfRZO2QkyfSMQAC7kz4m FsGKujYWOinhlrdcx0+OxOsNSNmH1wwabjTJmCsrFneTibUZxv6MY92IPCDTLDufdBs1 yiAFc8/06MyjhwO9KWhw0XAub5mHkUMOKwEi+C+jV734uRKhyo6m8J896RDTLq37+bEw 3V8Q== X-Gm-Message-State: AN3rC/7wyKT4ygGSavUBq59UXqMAmhVOi+owQjIiO0ZluXmBMzmqbSAM axNEfhWzxdOykL2r1mC5l9dMm7ZLsA== X-Received: by 10.28.139.136 with SMTP id n130mr2329298wmd.4.1493500005580; Sat, 29 Apr 2017 14:06:45 -0700 (PDT) MIME-Version: 1.0 Sender: php@golemon.com Received: by 10.223.157.38 with HTTP; Sat, 29 Apr 2017 14:06:44 -0700 (PDT) X-Originating-IP: [73.9.224.155] In-Reply-To: References: Date: Sat, 29 Apr 2017 16:06:44 -0500 X-Google-Sender-Auth: jgtVbZsL-b7FqmQKYqnaU2J217s Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] ZEND_ARG_TYPE_INFO usage in core? From: pollita@php.net (Sara Golemon) On Sat, Apr 29, 2017 at 3:54 PM, Nikita Popov wrote: > 1. In weak mode, arginfo type violations throw, while zpp violations warn > and return NULL. As such, adding arginfo types to existing functions is a BC > break. > 2. For methods in particular, prior to PHP 7.2, adding arginfo types was > also a BC break. This is no longer the case, as variance is now respected. > 3. Arginfo types for internal functions are enforced by the runtime. Because > the types are already checked by zpp, this is an unnecessary duplicate > check. Additionally, type-checking for internal functions is on the > slow-path (to the point there it uses a different opcode). While of course > this doesn't matter for some functions, in other cases type checking / > parameter parsing is the main overhead of a function (which is why fast zpp > was introduced in the first place). I'm sure we do not want to have > decisions on whether to add or not add arginfo for a particular function > based on whether it would have a significant performance impact. > > The solution to these problems is simple: Stop checking arginfo types for > internal functions, just use them for reflection / inheritance checks, but > leave the actual type-checking to zpp. However, this doing this will also > change current behavior due to point (1.), as in weak-mode some type errors > that are currently throwing would be reduced to warn + null. Personally I > don't have a problem with that, as I'd consider this a compatible change, > and it would make type-checking for internal functions consistent. > Ugh.... This is why we can't have things. I'm with you on personally being fine with not enforcing ARG_INFO hints in the runtime for internal functions (leaving it to zpp), but as you say that doesn't work due to #1. Something for 8.0, I suppose. -Sara P.S. Or to quote a common acquaintance: Who uses weak mode? Weak people, that's who.