Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62188 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32057 invoked from network); 15 Aug 2012 11:23:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Aug 2012 11:23:59 -0000 Authentication-Results: pb1.pair.com header.from=sebastian.krebs.berlin@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.42 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 74.125.83.42 mail-ee0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:35912] helo=mail-ee0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/87-30529-DC68B205 for ; Wed, 15 Aug 2012 07:23:58 -0400 Received: by eekb15 with SMTP id b15so419121eek.29 for ; Wed, 15 Aug 2012 04:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:x-google-sender-delegation:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=4m/v+WFMlXqn4G7ajNxodnsyUF5q88HnLttSmyCph1o=; b=rRKGnJoURuxBIvHLaexPjN7TBkxFzOAGqJM6y8PARomWJBXnpZoi6fv66HkzAEw5mk /arABxUT+x5MNw8cBWuKDODVU/9BhD//ON6TVZBNyZhRrToBWHYBDMmUkwtZSbts6xsG 90IfWErR/VJV/Luk8nNrBsTzMNh1gRNawkJWVu71AfxDJUhD+aeCqsEWyQ9M8YOwAbzj BQIW1Qu+ezPzpBo5XeFOjqqkfPj50fH+CB/p35e2IoT+NPI5ZWlb414fpUaapb9Gtwv/ qVSSfzdYxmSiBh9jT3D6BSIPtWMUm1MhM5CxrTkEKTLm6MXlBpJsFPmjBqVO4DmiqvaA F+oQ== MIME-Version: 1.0 Received: by 10.14.224.4 with SMTP id w4mr11275528eep.21.1345029835346; Wed, 15 Aug 2012 04:23:55 -0700 (PDT) Sender: sebastian.krebs.berlin@gmail.com X-Google-Sender-Delegation: sebastian.krebs.berlin@gmail.com Received: by 10.14.176.73 with HTTP; Wed, 15 Aug 2012 04:23:55 -0700 (PDT) In-Reply-To: <58A080733FC04ABDA51989286868DFC3@pc> References: <502A86AA.2030203@sugarcrm.com> <502B57AE.4070801@sugarcrm.com> <502B5C7F.1070708@sugarcrm.com> <6D84602D0F514FA3B82C11DBAF58AA53@pc> <502B5F8A.5000500@sugarcrm.com> <6281E4639C7248488268ACED88B86B7D@pc> <502B669E.7040702@sugarcrm.com> <1583D6716BFA4BF985E795A1363F465E@pc> <58A080733FC04ABDA51989286868DFC3@pc> Date: Wed, 15 Aug 2012 13:23:55 +0200 X-Google-Sender-Auth: p9fNGUQs17tXsbuTSIkLnM4zJ5A Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=047d7b6227d28c52e004c74c2912 Subject: Re: [PHP-DEV] Inline typecasting / typehinting for classes and interfaces From: krebs.seb@gmail.com (Sebastian Krebs) --047d7b6227d28c52e004c74c2912 Content-Type: text/plain; charset=ISO-8859-1 2012/8/15 Stan Vass > But "variable" typehints >> don't serve any such purpose. Actually, one could even say that they >> don't serve *any* purpose, short of providing the IDE with type >> information, because your code would work just as well even without >> the type check. If the type were wrong, it would just throw a fatal >> error when trying to do something with it (like invoking a method that >> does not exist). >> > > Just like with argument typehints. > Point me to an argument typehint that is required for your code to run. > Hi, Point me to an argument inerfaces are required. Or boolean (would could use 0/1 instead). Or abstract methods. Or function/methods parameters (we could use func_get_args()). Or default parameters. Or [insert random feature here]. Or: Point me to an argument, why the array of "Foo" shouldn't be a specialised class, that implements 'Iteratable'. With this your foreach "problem" simply disappear and everything, what remains, is something to make IDEs happy (with one line less to write...). My opinion Regards, Sebastian > > You and Stas keep giving arguments against argument typehints, which is > really awkward. > > Stan > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7b6227d28c52e004c74c2912--