Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58171 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24769 invoked from network); 27 Feb 2012 18:54:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2012 18:54:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain l-i-e.com designates 67.139.134.202 as permitted sender) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:3874] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A6/93-40985-561DB4F4 for ; Mon, 27 Feb 2012 13:54:30 -0500 Received: (qmail 46058 invoked by uid 98); 27 Feb 2012 18:54:30 -0000 Received: from localhost by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-2.05 ( Clear:RC:1(127.0.0.1):. Processed in 0.038759 secs); 27 Feb 2012 18:54:30 -0000 Received: from localhost (HELO www.l-i-e.com) (127.0.0.1) by localhost with SMTP; 27 Feb 2012 18:54:30 -0000 Received: from webmail (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Mon, 27 Feb 2012 12:54:30 -0600 Message-ID: In-Reply-To: References: <6d4a9f99bc550c8c673b32cbccc52444.squirrel@www.l-i-e.com> Date: Mon, 27 Feb 2012 12:54:30 -0600 To: internals@lists.php.net User-Agent: SquirrelMail/1.4.21 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] Object Casting - An Alternative to Type Hinting From: ceo@l-i-e.com ("Richard Lynch") On Mon, February 27, 2012 9:20 am, Anthony Ferrara wrote: >> I have to say that no matter how much a luv my OOP, turning every >> built-in type into an Object is just a Bad Idea... >> >> It's a form of bloat on RAM and CPU with minimal added value, imho. > Re-read what I had written. I never said to turn every built-in type > into an object. In fact, what I was talking about was keeping and > preserving the base types as-is. All that I was proposing was adding > the ability to cast from and to the primitives. That way you could > silently convert back and forth as needed (transparently when > possible). > I apologize that my brevity has been misconstrued. You are certainly free, even with the tools available in PHP, to "wrap" an object around integers, strings, and so on. There may even be occasions where I think that would be a Good Idea (tm). What I object to is building such a facility into core PHP, because: 1) You can already do it in userland, and I believe that's where it belongs. 2) It unnecessarily [see 1] complicates core PHP, whose major strengths that drive its success includes its simplicity. >> No matter which way you twist this pretzel: I had hoped that this bit would hint that all the proposals along these lines, including yours, are proposals I would vote against, even though I did over-blow your actual proposal. >> -1 > So what it sounds like you're -1ing to, is not actually what was > proposed... > > I'm starting to work on a patch for this as a proof of concept... Please do so! I'll still vote -1, but obviously others will vote as they see fit. All these ideas are welcome. The ones with complete patches even more so, as they allow a true idea of what the change would mean. Unfortunately, however, I must repeat that, so far, the idea has always fallen flat on its face when the proposer actually attempts to put action into deed, making a patch that fully meets their proposal. That doesn't mean you can't succeed, if you are more skilled than all your predecessors. -- brain cancer update: http://richardlynch.blogspot.com/search/label/brain%20tumor Donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE