Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41719 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88375 invoked from network); 6 Nov 2008 12:15:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2008 12:15:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=iammrdan@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=iammrdan@googlemail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.146.177 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: iammrdan@googlemail.com X-Host-Fingerprint: 209.85.146.177 wa-out-1112.google.com Received: from [209.85.146.177] ([209.85.146.177:59352] helo=wa-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/BA-35522-BEFD2194 for ; Thu, 06 Nov 2008 07:15:40 -0500 Received: by wa-out-1112.google.com with SMTP id j32so332109waf.7 for ; Thu, 06 Nov 2008 04:15:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=Tny92EaXog/ZVbAprENpQDjEPN4eZaJ/YyPP6lQjhzQ=; b=DQfsOqV4RuvHqQ2VFV/zxBhkVAjZ/dm6YGbgnwI7IelfgUewlKBwQDstErnLZ9fsdp y6OV7TJb5ECt9hafw2F+bgGSmBW3CZxAY+T1gTLIBZE6rzxKqDQbB1dDPftA/mZ07Buu UgdqWjYYZut8uPSCEo2RbUWzMcRQTNKsTy5GQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=vwNCXYSlu2ev+L7yLkiJsJ0TmK6S+q1NPbqxRLV/sGQVfnrrT0JXgXK1XaMzrQ1ccH cLeicBLKeCfwMJc5wpcZcEkY34XtcHMEZzoXCLlGwJjjFtwO/8LjWv8WDP3ddMpeTybq oiEliR2Fh0rhfuYzS8fJxBH/UEfdyAu4CdtAo= Received: by 10.114.159.17 with SMTP id h17mr628663wae.124.1225973736583; Thu, 06 Nov 2008 04:15:36 -0800 (PST) Received: by 10.114.195.17 with HTTP; Thu, 6 Nov 2008 04:15:36 -0800 (PST) Message-ID: Date: Thu, 6 Nov 2008 12:15:36 +0000 To: "Steph Fox" Cc: internals@lists.php.net In-Reply-To: <013b01c94007$b66d60a0$3ffc1f3e@foxbox> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6289_29425386.1225973736584" References: <4EA88C3A8A2747989925A5D21448FCE7@pc> <200811052154.29537.larry@garfieldtech.com> <98b8086f0811060150p2fb0312dj66896cb227c871ec@mail.gmail.com> <007301c93ffe$f4b5ad80$3ffc1f3e@foxbox> <029101c94004$d4564440$7d02ccc0$@com> <013b01c94007$b66d60a0$3ffc1f3e@foxbox> Subject: Re: [PHP-DEV] Call it: allow reserved words in a class or not? From: iammrdan@googlemail.com (Dan) ------=_Part_6289_29425386.1225973736584 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Okay, I'm not going to sit and argue it... but to anyone looking at these issues from outside the PHP internals world (like I am), that argument is worthy of ridicule. PHP may be a hybrid language, but the fact is you're implementing object oriented functionality, and as such should be implementing it in a way that follows de-facto standards in object oriented language design. I should be able to overload your internal array object, and yes, arraysshould be objects. Javascript would be a prime example of a non-standard object oriented approach, and yet that still manages to support the basics in a way that make sense. Dan On Thu, Nov 6, 2008 at 12:03 PM, Steph Fox wrote: > In .NET, I can stick an Array class into my own namespace, extending the >> System.Array type if I want to and use it in my code without issue. Why >> can >> I not do that here? Is it simply that you're so worried about backwards >> compatibility that you feel that you can't make the necessary changes to >> the >> language to implement something fully? >> > > .NET is an object oriented language. It has something called System.Array. > > PHP is a hybrid language. It does not and hopefully never will have > something called System.Array. > > It's like the difference between English and Esperanto... and you're > telling us 'cough' should rhyme with 'cow' because that's how Esperanto > would have it. But English is so much easier to learn, if more difficult to > master, that it's become the lingua franca for the 'net. > > - Steph > > > > >> Dan >> >> >> On Thu, Nov 6, 2008 at 11:43 AM, Ben Davies >> wrote: >> >> > Isn't the ability to do that one of the biggest reasons for having >>> > namespaces? To avoid having to fill your class names with junk. >>> > The examples are namespaced appropriately, they tell the developer that >>> > it's >>> > a Helper for Arrays in the MyFramework framework. I shouldn't need to >>> > suffix >>> > the class name with 'Helper' to reconfirm that, just because the PHP >>> > engine >>> > doesn't like it. >>> >>> "This thread really should be re-titled to "allow reserved words as a >>> classname or not". Then perhaps the only logical response to the question >>> would be so obvious that there would be no thread... oo-er..." >>> >>> I think you might be deliberately missing Dan's point here: array is a >>> reserved word because it is not namespaced. If the PHP native function >>> array() was namespaced to PHPCore\array() then Dan could create a class >>> or >>> function called array under his own namespace. This is exactly what >>> namespacing affords us. >>> >>> array() is only a reserved word because it is not a directly accessable >>> native datatype. If array() was an object Array, this wouldn't be a >>> problem. >>> >>> This namespaces issues highlights the very fundamental issues with PHP, >>> and >>> glib, childish responses like yours only serve to score points. >>> >>> Grow up and join the conversation. >>> >>> >>> Ben Davies | Lead Developer | Stickyeyes >>> 6th Floor, >>> West One, >>> Wellington Street, >>> Leeds, LS1 1BA >>> Email: ben@stickyeyes.com >>> 0113 391 2929 | | Fax 0113 391 2939 >>> >>> This e-mail may contain information that is privileged, confidential or >>> otherwise protected from disclosure. It must not be used by, or its >>> contents >>> copied or disclosed to persons other than the intended recipient. Any >>> liability (in negligence or otherwise) arising from any third party >>> acting, >>> or refraining from acting, on any information contained in this e-mail is >>> excluded. The views expressed may not be official company policy, but >>> instead, the personal views of the originator. If you have received this >>> e-mail in error please notify the sender and delete the e-mail. >>> >>> >>> >>> -----Original Message----- >>> From: Steph Fox [mailto:steph@php.net] >>> Sent: 06 November 2008 11:01 >>> To: Dan; troels knak-nielsen >>> Cc: Larry Garfield; internals@lists.php.net; ben@stickyeyes.com >>> Subject: Re: [PHP-DEV] Call it: allow reserved words in a class or not? >>> >>> > Isn't the ability to do that one of the biggest reasons for having >>> > namespaces? To avoid having to fill your class names with junk. >>> > The examples are namespaced appropriately, they tell the developer that >>> > it's >>> > a Helper for Arrays in the MyFramework framework. I shouldn't need to >>> > suffix >>> > the class name with 'Helper' to reconfirm that, just because the PHP >>> > engine >>> > doesn't like it. >>> >>> This thread really should be re-titled to "allow reserved words as a >>> classname or not". Then perhaps the only logical response to the question >>> would be so obvious that there would be no thread... oo-er... >>> >>> - Steph >>> >>> >>> >> > ------=_Part_6289_29425386.1225973736584--