Prototypal inheritance in PHP (like in JavaScript) -


Is it possible to employ prototype succession in PHP of any type such as JavaScript ?

This question came to my mind only with curiosity, not that I have to implement such a thing and go against the classical heritage, it feels like an interesting area to explore.

Are the retrospective tasks for adding classical succession model to the prototype inheritance in PR, combining the anonymous operations?

Let me assume that I have a simple class for the user modal

  class UserModel applied prototype inheritance {// satres, gates, arguments ... static public function prototype ) {}} $ User = new UserModel (); UserModel :: Prototype () - & gt; GetNameSlug = function () {return slugify ($ this-> getUserName ()); } Echo $ user- & gt; GetNameSlug ();  

You can use something to achieve something like this, but the real Prototical heritage is not found in javascript like afaik

If you are looking for something like mixins / symptoms, you can use it.

Although there is one.

What you can do is the prototype pattern that tracks the life cycle of its cloned objects through Splod ObjstaStorage. Whenever the prototype changes, the builder will have to walk through the map and adjust the examples accordingly. Monkey patching will be done through however. Not very imho sound possible :)


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -