Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44593 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24775 invoked from network); 1 Jul 2009 18:53:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jul 2009 18:53:07 -0000 Authentication-Results: pb1.pair.com header.from=paul.biggar@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=paul.biggar@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.227 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: paul.biggar@gmail.com X-Host-Fingerprint: 209.85.219.227 mail-ew0-f227.google.com Received: from [209.85.219.227] ([209.85.219.227:61986] helo=mail-ew0-f227.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/77-24906-290BB4A4 for ; Wed, 01 Jul 2009 14:53:06 -0400 Received: by ewy27 with SMTP id 27so1242453ewy.23 for ; Wed, 01 Jul 2009 11:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=LuN9uuSdFzHCuSJF0R5JTj3zLRHKn3zqOFeumGyBBlw=; b=hkQNUp2O22YnB7sE/uGmeybmm9eL7OWd3DizAGLxjfV1KtEeYbOTAu74Jmf3RZ9Dxj 3FdOzSq3WZbg3WCfgZKkb81Uqfn+z279C/HVk1s+Axbh3cnxm9H2s7DqHDy2EiJYy9uE 6GQvbqunNtkbxyN4bp+w9ZMwvCFMjm8edCFC0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=Q6Vuj7PKdguLCyorasSfMjaHEygkH4/8/PTGFS8JFe5a3E7qaQ63Kyrgv1y/S9J76j tzBhx7Q7VZosgP/OrxgSypc9cLiikDt8f20+EyCmDn+LGD4A5n6uc9ynLZOIIuEcgptT MVYtw6VB/IjFNIONZGpGHUPp5tIQWqZYv/KPw= MIME-Version: 1.0 Received: by 10.210.67.4 with SMTP id p4mr5482589eba.21.1246474383383; Wed, 01 Jul 2009 11:53:03 -0700 (PDT) In-Reply-To: <4A4BAE7B.3020601@zend.com> References: <4A4BA5C8.1020204@zend.com> <4A4BAE7B.3020601@zend.com> Date: Wed, 1 Jul 2009 19:52:41 +0100 Message-ID: To: Ilia Alshanetsky Cc: Stanislav Malyshev , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3 From: paul.biggar@gmail.com (Paul Biggar) On Wed, Jul 1, 2009 at 7:44 PM, Stanislav Malyshev wrote: > Hi! > >> As far as your point goes, numeric hint addresses it. > > Numeric hint addresses one scenario only. It doesn't address conversions to > strings or booleans, for example (even C allows you to use int as boolean! > :). I agree. We won't be able to use an int type for something which should take an int. That might not matter in user code, but if we cannot actually type hint internals functions then its a problem. I think it should be a requirement that internals functions should be able to be type hinted using what the manual says. We don't need to be too strict on that, but if that manual says int, it should be hintable with int, and accept "1". My feeling is that scalars should be automatically coerced to the correct type, if it makes sense to do so. (ie reject non-numeric strings for ints). Thanks, Paul -- Paul Biggar paul.biggar@gmail.com