Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67615 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23672 invoked from network); 3 Jun 2013 17:20:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jun 2013 17:20:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.179 as permitted sender) X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.223.179 mail-ie0-f179.google.com Received: from [209.85.223.179] ([209.85.223.179:37165] helo=mail-ie0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/F4-21406-660DCA15 for ; Mon, 03 Jun 2013 13:20:38 -0400 Received: by mail-ie0-f179.google.com with SMTP id c10so5224163ieb.24 for ; Mon, 03 Jun 2013 10:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=ZcC+8RUFBtVBoTCz3okPyoP5ZpiVqnZDVZH0r9z2Fmg=; b=VG6u0awBqj9p0aMg1d14Z/IkZsJ8AXhOVat5sbVyYcwKPRc2+T4zGnLzPOT+7QAgi2 W8422u1fX2ByLxaLsiAXUaqorrS2ngfyV6eIpsGHubBA9xghxeZzSoKqOv4jp5DUjByg +7r+O/ClXqXJnQO201qWnY0VGgyFNFJWGlfup1XWiqANfibM8wS0X8qSTvBjcRZU1lSi VtQ3Pe11REnTYhVZTj++S7T9o3lr5cfyos6Timij/43dw4VPoJCC8XTE330gInjczDSZ uPr1bkaryl844vcZk84zNKSZzE7kaWdfNXUQ8vklKEHlrmBoCqq3k9JHrGIlW/wvqAWX HFIg== X-Received: by 10.50.55.70 with SMTP id q6mr8357891igp.81.1370280035940; Mon, 03 Jun 2013 10:20:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.23.5 with HTTP; Mon, 3 Jun 2013 10:20:15 -0700 (PDT) Reply-To: RQuadling@GMail.com In-Reply-To: References: Date: Mon, 3 Jun 2013 18:20:15 +0100 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7b10cd31c9043a04de432ea7 Subject: Re: [PHP-DEV] Random Monday thought. From: rquadling@gmail.com (Richard Quadling) --047d7b10cd31c9043a04de432ea7 Content-Type: text/plain; charset=UTF-8 On 3 June 2013 17:55, Nikita Popov wrote: > On Mon, Jun 3, 2013 at 6:49 PM, Richard Quadling wrote: > >> Hi. >> >> Recently the setters/getters rfc was declined. >> >> Other than the vote, was there any technical reasons? >> >> I've been sitting here and had a thought. >> >> Currently, if I use ... >> >> > class some_base_class {} >> ?> >> >> I can, sort of, think of this as ... >> >> > class some_base_class extends \stdClass {} >> ?> >> >> in as much as \stdClass has no constants, properties or methods. In fact, >> no behaviour at all. >> >> Now, could it be possible that I could have another PHP maintained base >> class or interface that DID support setters/getters? >> >> So, I would have to make the decision at develop time ... >> >> > class some_base_class extends \stdClassThatHasSetterGetterSupport {} >> ?> >> >> sort of thing. >> >> So, for classes NOT extending \stdClassThatHasSetterGetterSupport, the >> variable/property handling to be used is the original style. >> >> But for those base classes that do extend from >> \stdClassThatHasSetterGetterSupport, then these would have property >> support. >> >> >> Is this even possible/feasible? >> >> Whilst the vote went against the initial rfc, I'm happy to accept that >> (though I wish it had passed as I like the black boxing and the semantic >> cleanliness it would provide - IMHO). >> >> >> To me, if the internals operated as ... >> >> > class \stdClassThatHasSetterGetterSupport extends \stdClass {} >> ?> >> >> add if that was enough to enable setters/getters, then COULD this be a way >> forward for PHP supporting new functionality without breaking base >> functionality? >> >> In essence, turning PHP's internals into a sort of OOP framework. >> >> Regards, >> >> Richard. >> > > PHP does not support multiple inheritance. So no, this doesn't solve > really the issue. > > Nikita > I'm not talking about multiple inheritance, but of extension. A new internal PHP base class which internally extends from stdClass, but is a class that provides additional functionality, specifically setter/getter logic. So, from userland, I can not extend and get the current stdClass, or I can choose \stdClassThatHasSetterGetterSupport and get that. And if I so wish, I can implement SomeOtherPHPSuppliedIterfaceLikeIteratorOrWhatever. Richard. -- Richard Quadling Twitter : @RQuadling EE : http://e-e.com/M_248814.html Zend : http://bit.ly/9O8vFY --047d7b10cd31c9043a04de432ea7--