Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62180 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18968 invoked from network); 15 Aug 2012 10:15:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Aug 2012 10:15:45 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:64756] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/C4-30529-0D67B205 for ; Wed, 15 Aug 2012 06:15:45 -0400 Received: by lbbgp3 with SMTP id gp3so806633lbb.29 for ; Wed, 15 Aug 2012 03:15:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=u/WO1dbaKAeo1j7JPLUa5wS/T0Upz6QJ/1qaHAQu7yQ=; b=SdKZt5efuAdqRHHkg1wcmpX/C5prE15UMUaty4fLRIChkIpq/sqwZn9vukUOIpwjEF /gsgDS28GKYKMiDUA8S4KRddr14sMUQmTtJ9gkcV5xNLkOLKHCwYHL0Nk3r/DT0a09VK CIpbSjDtB17/ITu5D+O2lphyHudBJOc7ODCbZZv/XTQhiVVuJfbB7uhbP4SD9GycyNHU HPVoDOAX13XRatnZ8Qc1M9CzUI89b2K5Bb47YILtNh/LX1GnBuu1sul9wYf2tVG+QY74 JtXvtQIBUk0nBR07bavHrqZ76ao8+czyBlxLWiEa0DEjs0P55UduUGOW+5m+6CA4mGKA 1pcA== MIME-Version: 1.0 Received: by 10.112.46.101 with SMTP id u5mr9302855lbm.21.1345025741392; Wed, 15 Aug 2012 03:15:41 -0700 (PDT) Received: by 10.152.122.51 with HTTP; Wed, 15 Aug 2012 03:15:41 -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 12:15:41 +0200 Message-ID: To: Stan Vass Cc: Stas Malyshev , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Inline typecasting / typehinting for classes and interfaces From: nikita.ppv@gmail.com (Nikita Popov) On Wed, Aug 15, 2012 at 12:01 PM, Stan Vass wrote: > Just like with argument typehints. > Point me to an argument typehint that is required for your code to run. > > You and Stas keep giving arguments against argument typehints, which is > really awkward. As already pointed out repeatedly, argument typehints serve the purpose of defining an interface. No, they are not required to run the code, that's true. But they still serve an important purpose for object oriented programming (and, just to make sure that you don't miss it again: That purpose is defining the interface). Variable typehints do not, as far as I can see. > I gave an example validating an array of Foo instances, which the current system doesn't solve. Yes, and your system doesn't solve it either, or does it? As the validation does not happen through a parameter typehint it does not help defining the public interface. It only helps the IDE know the type (which doc comments can also do). Nikita