Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53092 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8221 invoked from network); 6 Jun 2011 22:41:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2011 22:41:41 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:34743] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 16/65-23189-3A75DED4 for ; Mon, 06 Jun 2011 18:41:40 -0400 Received: by bwz18 with SMTP id 18so4280869bwz.29 for ; Mon, 06 Jun 2011 15:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ZflL2AQTn9t4ngm515fstLaHcghS/QQ9FtE1gceBUhs=; b=UW1YJcJVQjF9zltb1QnZcbxh9BwpTQM1NtzcEPeoeOT3EDphlrFnLMEsODys1aRARK JporSQaoiOTwS8t7HhPj6tMqBBCt0Am8OghAmHSY0RBQosPpQaDTgg5aBrnBys676ymM 5Jm+Q6n4GaZyLp5e7IQyLLt05nhu3CJJUf+Lg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=TrIE7TBg7houkbhRaN+sGXsusOcNTzJaKgqniOhyZllpn8KQZDaRYP1PoGw7/2DDsh l/KezXmtAa0q/XCUZByHWYlujogJeehGzqsyF55oKsNuLM4gM9QXqMyH0d/PWssEHxy0 7GModagVO1wK7G6FYI0po66LJbNOl9fe3Rllo= MIME-Version: 1.0 Received: by 10.204.8.72 with SMTP id g8mr4144930bkg.103.1307400096673; Mon, 06 Jun 2011 15:41:36 -0700 (PDT) Sender: ekneuss@gmail.com Received: by 10.204.66.195 with HTTP; Mon, 6 Jun 2011 15:41:36 -0700 (PDT) In-Reply-To: <4DED3A29.1090209@sugarcrm.com> References: <4DED3A29.1090209@sugarcrm.com> Date: Tue, 7 Jun 2011 00:41:36 +0200 X-Google-Sender-Auth: ks7drIki3l9AIInfSxGAmbcJMNE Message-ID: To: Stas Malyshev Cc: Hannes Magnusson , PHP Development Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Callable typehint From: colder@php.net (Etienne Kneuss) Hi, On Mon, Jun 6, 2011 at 22:35, Stas Malyshev wrote: > Hi! > >> See attached patch+phpt; Any objections to include it in 5.4? > > Yes, same objections as for other static typing. Those objections do not apply here IMO. IIRC, the main objections were that if we introduce strict hints for scalar values, then we start rejecting stuff that would "just work" via implicit conversions before. i.e. "2" vs 2. In this case, if you don't provide a valid callback to a function expecting a valid callback, there is no way it will "just work". Just like with other type hints, if you write function foo(A $b) and pass B which is not a subtype of A, there is no way foo() will "just work", as there is no way it will be able to interpret the value, an object of type B, as an object of type A. +1 from me, this seems very useful. > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Etienne Kneuss http://www.colder.ch