Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68129 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38696 invoked from network); 16 Jul 2013 11:12:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2013 11:12:09 -0000 Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.178 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 74.125.82.178 mail-we0-f178.google.com Received: from [74.125.82.178] ([74.125.82.178:50158] helo=mail-we0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/A7-20914-78A25E15 for ; Tue, 16 Jul 2013 07:12:09 -0400 Received: by mail-we0-f178.google.com with SMTP id u53so467764wes.23 for ; Tue, 16 Jul 2013 04:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=6n1Xm9Zipw94voDfn6XQ6kyComxWCQHR3h6V6o9emqQ=; b=qcZELTJkangFfOfpDU4bPq/QLPYLx/36Md1gwBk0bBE6Jm9pmj1DjxhbSx1txXllNj mQzjFYzz6Xh33uhmpJCo3K+zxmXFL1sJfWx8rEpKJFq2Nu4KWc3GjsXl3zF5MtTzo9AE L8wVWyEkfR+yER+IUZbYw5i79NN27Cep9sGXL9CA78VM9sJb0o+huwgbgZMUyZeH6h/0 waBfIhQvu6L9o7Sb3bOCXl4XL24EZXSmx94VyD0343xFgDA1ubQ1v4RWo0sC6UROWEb8 yM8Dvu932F4MWOKNRXGB0ReGHDfUNHcdBMQM6iN/bqR0FpYVuM1PCO2iI18x0oYdz2lC MIRg== X-Received: by 10.194.237.38 with SMTP id uz6mr751433wjc.73.1373973123992; Tue, 16 Jul 2013 04:12:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.224.129 with HTTP; Tue, 16 Jul 2013 04:11:23 -0700 (PDT) In-Reply-To: References: <1373879683.17031.4.camel@guybrush> Date: Tue, 16 Jul 2013 13:11:23 +0200 Message-ID: To: Giuseppe Ronca Cc: PHP internals list Content-Type: multipart/alternative; boundary=089e01419fd6fc934504e19f0b75 Subject: Re: [PHP-DEV] PHP proposal on modular systems From: krebs.seb@gmail.com (Sebastian Krebs) --089e01419fd6fc934504e19f0b75 Content-Type: text/plain; charset=ISO-8859-1 2013/7/16 Giuseppe Ronca > You can have multiple objects from the same type in different >> implemenations in the same process? >> > > > No i'm not saying it. > > OK, what then? You have A and B, that both rely on X, but in version 1 and 2. Both A and B are used at the same time. How can now be possible, that X is _not_ instanciated in the same process with different implementations? > > >> What should happen, when I instanciate an object of "test" in version X >> and >> pass it to a function, that expect it as version Y? To be consistent PHP >> _must_ trigger an error too, if something from the locally included file >> leaves its scope >> class foo { >> public static function bar () { >> local_include "test.php" / / file which includes "test" class; >> return new test (); // <-- error here >> } >> } >> Because else it is not a local scope anymore. >> > > > the concept as i said is the same of "nesting" a class inside another ( or > dynamically namespacing a file ) > > > if two different components need "Library v1.0" and "Library v2.0" .. they > will probably have same classes and namespaces ( but the code is not the > same ). So how could we use both lib at the same time? Actually php can't > load classes in a scope way so you can't do it in any way on global scope. > > nesting dynamically libraries inside a namespace or a class , we can > create objects that can be accessed only throught their root > namespace/class...something like: > > new Version1\ExternalLibrary\FooClass(); > > new Version2\ExternalLibrary\FooClass(); > > and also Composer will thankyou about it since they can solve > automatically problems . > > It will lead to new problems... Lets say you have a third component C, that works both X in both version 1 and 2. So now I say "new X()". What should happen? If 1 is instanciated, it is compatible to A, but if 2 is instanciated it is compatible with B. I cannot simply pass that object to A and/or B. > > > >> Backward compatibility (or compatibility in general) between component is >> something the plugin maintainer should take care of, not the language. >> Regards, >> Sebastian > > > > i'm talking about backward compatibility of php version...not external > plugins etc...i think that my idea doesn't require any change to php apps > to adapt their code. > > But I am talking about compatibility in general (or backward compatibility in special). :) -- github.com/KingCrunch --089e01419fd6fc934504e19f0b75--