Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44897 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93006 invoked from network); 10 Jul 2009 10:51:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2009 10:51:14 -0000 Authentication-Results: pb1.pair.com header.from=lewiswright@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=lewiswright@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.220 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: lewiswright@gmail.com X-Host-Fingerprint: 209.85.220.220 mail-fx0-f220.google.com Received: from [209.85.220.220] ([209.85.220.220:63080] helo=mail-fx0-f220.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BB/44-23850-12D175A4 for ; Fri, 10 Jul 2009 06:51:14 -0400 Received: by fxm20 with SMTP id 20so740805fxm.23 for ; Fri, 10 Jul 2009 03:51:10 -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 :date:message-id:subject:from:to:cc:content-type; bh=Gl1U4WG02Rlc914hliWkpCiNBRtLsRosBfq87KIc0mI=; b=YINrVDvrU0EupCY8C7gWoJ10++HTpNmo+LwbwndWbCgnja/55dg+KXelVvjojtH2tr IXs+qHynUDcgphu1WCQlCDjZEb1Sa3kLmn8SkAQBCa7U7/IvBe8p8GwdVytkCvAAQrKP 4zu5IULv5GAUxsY0OdbIDA5RgcFe+M9wej0qY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=VC3qi6TWM6ZbTZZjUhDmVH2UHrLgJpmcK/xUVV56VQbfoR3i410xL58rpzTv9nHSQm gKcpUPp1NZU3svf7ENABVHJz+Klei1HHsalpVggCsd1Gxq8EzjRJt6EeK8DHJNFM8oC5 d9M9fUZcABEevX4TJepShBJGyGATWFs31xJU4= MIME-Version: 1.0 Received: by 10.103.242.20 with SMTP id u20mr998788mur.0.1247223070492; Fri, 10 Jul 2009 03:51:10 -0700 (PDT) In-Reply-To: <4A571981.80900@gmail.com> References: <7.0.1.0.2.20090708224156.0ac5a438@zend.com> <312025EF-84D0-4411-A0A7-4F0379C3105F@pooteeweet.org> <22CAD497EA2F476DAECEF9302D0B087A@pc> <98b8086f0907091150r47e7a103jaa50fcf7d5b32186@mail.gmail.com> <4A568B33.9000501@gmail.com> <98b8086f0907091744w7ab598dckc427d0a9484664b2@mail.gmail.com> <20090710102302.GC20283@gerbil.thgnet.it> <4A571981.80900@gmail.com> Date: Fri, 10 Jul 2009 11:51:10 +0100 Message-ID: To: "Ionut G. Stan" Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=00163662e56b128c8b046e57c0b9 Subject: Re: [PHP-DEV] Type hinting - Request for Discussion From: lewiswright@gmail.com (Lewis Wright) --00163662e56b128c8b046e57c0b9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/7/10 Ionut G. Stan > On 7/10/2009 13:23, Giovanni Giacobbi wrote: > >> On Fri, Jul 10, 2009 at 02:44:52AM +0200, troels knak-nielsen wrote: >> [...] >> >> >>> For example, instead of: >>> >>> function addFive(int $x) { >>> return $x + 5; >>> } >>> >>> You would simply do: >>> >>> function addFive(is_numeric $x) { >>> return $x + 5; >>> } >>> >>> Since $x is guaranteed to be numeric, it is safe to to arithmetic on >>> it. No reason to explicitly type cast here. >>> >>> >>> >> I like it too. Not only it solves the initial problem, but it also allows > userland extensions. For example, > the current patch does not provide checks for callables, but we already > have is_callable in the core. But isn't is_numeric still a valid class name? Would that mean that classes could no longer be called is_*? --00163662e56b128c8b046e57c0b9--