Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67616 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25078 invoked from network); 3 Jun 2013 17:22:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jun 2013 17:22:34 -0000 Authentication-Results: pb1.pair.com header.from=brandon.wamboldt@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=brandon.wamboldt@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.181 as permitted sender) X-PHP-List-Original-Sender: brandon.wamboldt@gmail.com X-Host-Fingerprint: 209.85.214.181 mail-ob0-f181.google.com Received: from [209.85.214.181] ([209.85.214.181:49226] helo=mail-ob0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/45-21406-8D0DCA15 for ; Mon, 03 Jun 2013 13:22:32 -0400 Received: by mail-ob0-f181.google.com with SMTP id 16so7635777obc.26 for ; Mon, 03 Jun 2013 10:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=E5FIG2zibVQ5smi2i0mIK7PsoxVK+1d49JZjvys5DDs=; b=gklFD7Y8woQNLQCkR3/c4zad4Ct7DB4yISZb/VenyRqB1stuqoKOPQ4lvkOVzG84YW pQwecb6TQ1vpaMkrCKwGTLQDJRVVkKuVNMgl4rESB2pGHnJFn915/2KMgvqsmvzwSBEC Pl5IsaCcxFwbpNz7KaCDNesO55tN531+/BypVKJ0+evrt63NHeEQ5TaqW79Ty3eB3dvj rNwANiKrSXAEuVBW7XpPGQeqv53FVLiQjeovOBw0hkmVAYcc3jZA+lJglMbqCBuz9thN wdjRpgWYdJfGvotHR/LeqMPCEXhLFDYRxaj+A9+pO2oeEX6iqbNAsZsEntOMuDNQoorQ fEdQ== X-Received: by 10.60.134.204 with SMTP id pm12mr10804037oeb.67.1370280149609; Mon, 03 Jun 2013 10:22:29 -0700 (PDT) MIME-Version: 1.0 Sender: brandon.wamboldt@gmail.com Received: by 10.60.29.10 with HTTP; Mon, 3 Jun 2013 10:22:09 -0700 (PDT) In-Reply-To: References: Date: Mon, 3 Jun 2013 14:22:09 -0300 X-Google-Sender-Auth: M3zAzjL0Qw2L9qgBGEkJDsmsAq4 Message-ID: To: RQuadling@gmail.com Cc: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=047d7b471dc48f75be04de4335f5 Subject: Re: [PHP-DEV] Random Monday thought. From: brandon@brandonwamboldt.ca (Brandon Wamboldt) --047d7b471dc48f75be04de4335f5 Content-Type: text/plain; charset=ISO-8859-1 I think the point was that if somebody wants to extend one another class, maybe one of the SPL classes for example, they can't also extend the base class with getter/setter support so it's an incomplete solution that will frustrate many users. On Mon, Jun 3, 2013 at 2:20 PM, Richard Quadling wrote: > 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 > -- *Brandon Wamboldt* Software Engineer Resume/CV - Personal Site/Blog - LinkedIn - StackOverflow Careers Profile - GitHub Profile --047d7b471dc48f75be04de4335f5--