Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62144 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12675 invoked from network); 14 Aug 2012 15:29:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2012 15:29:26 -0000 Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 209.85.215.170 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:63887] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/6B-00812-6DE6A205 for ; Tue, 14 Aug 2012 11:29:26 -0400 Received: by eaao11 with SMTP id o11so189231eaa.29 for ; Tue, 14 Aug 2012 08:29:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:from:to:cc:references:subject:date:mime-version :content-type:content-transfer-encoding:x-priority:x-msmail-priority :x-mailer:x-mimeole:x-gm-message-state; bh=Wqj/uOXy7Vz2RIw1L/w2cagg9q7Kw0rTxRnZ/MN6Ffs=; b=llBWEm0JC5mP2kcHk7BaVslWsJ6deRsi/B5GOKAdgbSKwJIyGZJLRQbxEUxpRmaYpD MbdMAXOSQPuGpB/ahf73c101W0sLtGPJtj5EBYO0NuYt4vS6/Q3g/4p/7D1pD7iIMCCp k4MXHdAV44kP/nMDdcTLWFQ3ukSoqAX2Lxr7KYG8MaO1pNo8wg0oQgNAj9OM90zu07z9 SGsJ4kwHGD5+G0gcCO++GTxQZRHrX7L2GUakYL3slMIagL4rF9dJOJHova+wktVLmtT3 oDc2K8jnpzY1rgjQS43k+ClaFcDHQOGtphLAeviTOEFRMFQYK1X2dzHf6ndys1RwLZRU 0Ffg== Received: by 10.14.199.67 with SMTP id w43mr15792845een.33.1344958163239; Tue, 14 Aug 2012 08:29:23 -0700 (PDT) Received: from pc (95-42-66-13.btc-net.bg. [95.42.66.13]) by mx.google.com with ESMTPS id k41sm7723321eep.13.2012.08.14.08.29.20 (version=SSLv3 cipher=OTHER); Tue, 14 Aug 2012 08:29:22 -0700 (PDT) Message-ID: <11C69123FA4344AFAC538DD431AEFC61@pc> To: "Levi Morrison" Cc: References: Date: Tue, 14 Aug 2012 18:29:18 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Gm-Message-State: ALoCoQlzmWrsZVniNtRWlGUp/7AfYfnP3eajEiIIsPoU3hFXP5z8M3fhi85oMf8PIKd6qMcFJOSH Subject: Re: [PHP-DEV] Inline typecasting / typehinting for classes and interfaces From: sv_forums@fmethod.com ("Stan Vass") >> Proposed syntax: >> ------------------------- >> >> $x = (InterfaceName) $container->service; > > I'm against this. Let's be honest, how different is this that an > optionally static type? > > InterfaceName $x = $container->service; > > To be clear, I WANT optionally static typing. For the most part, > type-hinting in class methods solves the static typing needs, but if > we were able to declare a class member to be a certain type that would > be another significant improvement. I have a proposal in the works, > but I don't want to hijack your thread. > > To sum up: I think we need something LIKE what you are proposing, but > I'm against this particular proposal. What you want is option 4 under my alternative syntaxes section :) I'm ok with syntax 4, in fact, the more I think about it, the more I prefer that one (the one you want). I don't mind the syntax as much, I want the feature. Stan