Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61984 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93321 invoked from network); 3 Aug 2012 02:46:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2012 02:46:05 -0000 Authentication-Results: pb1.pair.com header.from=theanomaly.is@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=theanomaly.is@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:38656] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E8/75-61111-B6B3B105 for ; Thu, 02 Aug 2012 22:46:04 -0400 Received: by lbgc1 with SMTP id c1so1474210lbg.29 for ; Thu, 02 Aug 2012 19:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=V4Ag6cIZG4C6iXZ8EnN6StT4F1sGJjbfIQhLikybhbY=; b=C+j/imcVnkH5e9ftp3w9hBAyw4wqLnpP2upBLc3C9VpnRTh83XSysIG+OmPGSUfPQl dElwsxOvk2cJDRTL70a9kqspnELHt3bF5VO4WUHwZX5zrBvhhQPm6smvnQ6kTMMC120j cIMZtVfk1IWZeBidg+HVcAo8JoK/oD1YKRtCX4uZNjMcsKwQCs0TR5FOOpDCv3os1RdW 6exYAFWJ6krYepEQizS0syt3ydXIfLkrGwDtFTEBA6WBibW6LkTQlsVnK6urvXvLmQyC THfA1OYu09B3aV94cSVNCvjbB5Ivahsx4z4eeSyhkpUQkJsHHK0SJ7HDA3z7r/QXEhO1 e9tA== MIME-Version: 1.0 Received: by 10.112.39.135 with SMTP id p7mr20969lbk.78.1343961960365; Thu, 02 Aug 2012 19:46:00 -0700 (PDT) Received: by 10.112.26.234 with HTTP; Thu, 2 Aug 2012 19:46:00 -0700 (PDT) In-Reply-To: References: Date: Thu, 2 Aug 2012 22:46:00 -0400 Message-ID: To: Yahav Gindi Bar Cc: Anthony Ferrara , Sara Golemon , Leigh , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Add runkit to PHP Runtime From: theanomaly.is@gmail.com (Sherif Ramadan) > > I don't see why this is not a good programming practice, lets get the > following example: > class Member { > public static function create(...) { } > public function update(...) { } > public function remove(...) { } > // ... > } > > now you wish to add, for example, a ban functionally to this member class - > I don't see a good reason to extend this class - it doesn't answer on the > OO concept and just make things complex and even wrong in OOP aspect. > > Another example I thought of is Reflection class - for example, the Zend > Framework got reflection classes that add more features to the built-in > Reflection classes - why shall the base Reflection classes has to be > extended (talking about the concept aspect)? the extending doesn't answer > on the OO concept and the programmers had to extend it only because they > can't add more features to class without extending it. > This was about as poor of an example as you could have picked. This is not a problem you should be looking to solve at runtime. It is certainly easier to solve this problem correctly via extending or coupling the class. I don't understand why you believe digging into the guts of a class at runtime and adding new methods to it is a good idea or why extending a class in order to add to or alter its functionality in some way is not an Object Oriented concept. Classes should be closed for modification but open for (From SOLID OOP principle Open/Closed principle: http://en.wikipedia.org/wiki/Open/closed_principle). How this makes things *more* complicated is beyond me and you offer no compelling reason to believe that it is. I'm sorry, I see no viable argument to agree with you that any of this is a reason to put runkit (which was -- as stated by the original author of the extension -- nothing more than an experiment that was never meant to be complete for production) into PHP core. I think runkit has some nice uses in situations that relate to unit testing or other special cases, but I see no reason to believe it will prove useful in a production environment, which appears to your primary motive. Since you stated that you would intend for this to be used in framework development and deployment such as in the case of deploying on a shared hosting environment where the user may not have super user rights to install new PHP extensions. This is simply going to indulge users to attempt solving their problems the wrong way. That's a poor approach. I would support further work on the runkit extension in PECL. Sara hasn't done any work on it lately, but I can see how furthering that extension will benefit the community. Just not to the extent that I believe it belongs in PHP core. At least not until its features prove to solve problems for the majority of users that they can not otherwise solve easily with the given language features. None of the aforementioned reasons in your reply indicate this thus far.