Hi Nathan, On Sat, Mar 21, 2015 at 1:01 PM, Nathan wesley <nathan.o.wes...@gmail.com> wrote:
> I know that many people talked about this over and over. > > Why it’s not possible to change the old PHP API ? > > The answer is always because it will make HUGE BC breaks > > I’ve seen this wonderful idea about scalar objects authored by nikic > github https://github.com/nikic/scalar_objects. > > This will become even more possible when PHP 7 is introduced because of > scalar types and many great features making the idea more reliable. > > This makes an opportunity to replace the old API with object oriented one > preventing any kind of BC break. > > But instead of using this as an extension because of some limitations like > “string”->startsWith(‘s’); the API should be bundled with the engine (not > written in PHP). > > This will make the opportunity to also remove any inconsistencies in the > API behavior as well. > > I know that many people here will say that it’s not that important > developers get used to this API and many tutorials based on it. > > But it’s actually really important for the future of the language may be > not so much for the existing developers (I disagree it’s). but this will > also encourage new comers to use PHP. > > I’ve seen many articles encouraging new comers to learn languages like > Python or Ruby, and highly discourage them from using PHP. Also many new > projects are using languages different than PHP. (don’t tell me you haven’t > seen this) > > This will be an issue the number of language users will drop significantly > over the years causing the death of the language. > > I know that this is not an easy task. But this is a wonderful opportunity > to do this without BC breaks. I’m not suggesting that this should be for > PHP 7.0 because it will take a lot of work may be for any release in PHP > 7.* > > PHP internals around 40 people ? not really sure but I know you are very > busy with fixing bugs and you have a lot of work already if you think this > is a huge task it can be assigned to a good group of people similar to how > the amazing PHP Framework Interop Group has accomplished, > > for Designing the new Object Oriented API. PHP internals will vote on the > design and implement it. > > The old API should be deprecated in PHP 8.0 and removed completely in PHP > 9.0 (finally) > > I hope that you take this seriously and tell me if there are any > limitations that prevents this from happening. > I don't think almost all of old API will not be removed. "Replace" wouldn't work well as it breaks apps unnecessarily. What we can do is "Provide new API and improve old API, while keeping compatibility as much as possible". Anyway, we are better to decide how PHP internal is going to use namespace ASAP. It gives us a lot freedom for introducing new API while keeping compatibility. I fully agree that consistency is very important. Let's be consistent as much as possible. Regards, -- Yasuo Ohgaki yohg...@ohgaki.net