Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42689 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25349 invoked from network); 18 Jan 2009 22:44:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2009 22:44:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=nrixham@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nrixham@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.33 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: nrixham@gmail.com X-Host-Fingerprint: 209.85.219.33 mail-ew0-f33.google.com Received: from [209.85.219.33] ([209.85.219.33:52449] helo=mail-ew0-f33.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/9D-49574-5C0B3794 for ; Sun, 18 Jan 2009 17:44:22 -0500 Received: by ewy14 with SMTP id 14so170473ewy.23 for ; Sun, 18 Jan 2009 14:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=1srMwGr39LzowMI2LpDXUyG/6wkPOHriGVaygpl9Gf4=; b=csuIIGHS5JACsb+xbwdlv6YUz3jzppXKRbwP2+julg+1tmQvv5AcNAePcnQBufo33j rVePaVEmcn9biY0NGcj5MgnHe1SjtTlyBoYICgGRMr0IEl9gfEU/+YyFRdGYNb0GfXDb FEKTTjiFeWqn79G3RK31nJdX3lNWJ7lirl09Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=k0UxM5Qr2MGMqJhDOrgyPWcAA16MrLDSvgwuJcufMpR7qT2zLe2zbvsddzpMWzjlZu cJ/qrgAeE1AtGWPTuwGXAxOTDwdD5SzdRdVAHgXnUXZfcxNEp5LTQuYj69W9AvcT+POJ gNIRcuhFVbds3N3LvNe33RgiKaLRmgqZcdT5M= Received: by 10.210.76.4 with SMTP id y4mr1409157eba.176.1232318658955; Sun, 18 Jan 2009 14:44:18 -0800 (PST) Received: from ?192.168.2.6? (82-41-135-70.cable.ubr02.grth.blueyonder.co.uk [82.41.135.70]) by mx.google.com with ESMTPS id b33sm6755416ika.3.2009.01.18.14.44.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 18 Jan 2009 14:44:17 -0800 (PST) Message-ID: <4973B0B7.7050102@gmail.com> Date: Sun, 18 Jan 2009 22:44:07 +0000 User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: viroteck@viroteck.net CC: Hannes Magnusson , Lukas Kahwe Smith , internals@lists.php.net References: <58.5A.41390.72012794@pb1.pair.com> <7f3ed2c30901181131x5f89eb55u3f25c75195d7279@mail.gmail.com> <4973A18F.1040808@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Really Need.. From: nrixham@gmail.com (Nathan Rixham) Robin Burchell wrote: > On Sun, Jan 18, 2009 at 9:39 PM, Nathan Rixham wrote: >> I've reworded my original mail completely maybe this one will have more >> feedback (or not) >> >> question: Would anybody else like to see, or feel the need for, *optional* >> type hinting of variables and class properties in PHP? >> > > I was involved on a thread on exactly this some weeks earlier. I (and > a few others, though I don't really remember specifics) would very > much appreciate the possibilities of proper code structure when > working with large teams that this could help provide :) it was a thread "q on primatives" i think.. guess who started it *ducks* > > (As to your original proposal, multiple method signatures is something > I've come across a need for *occasionally*, though personally, I'm not > a big fan of the feature -- the one place I would like having it is > __construct(). noted; found the same thing, another specific being that all classes have a default no arg constructor so it can be instantiated prior to calling the setters even if there's a constructor which demands params. > Say, you've got an ORM class which is derived for usage: [snip] very interesting that you give an ORM example; this is exactly the area where I've found the need for this class property type hinting (and on web services tbh) - but still, mapping a "private bool $flag" to a tinyint(1) is so much easier than mapping a "private $flag" to it (complications multiplied somewhat with other data types) > Yes, I realise that this can be done with retrieving arguments and the > like, but for such purposes it's not the neatest solution > syntactically.) agreed any possible implementation in php feels like more of an inefficiant hack tbh (perhaps a bit strong..)? cheers!