We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Make me a JS Object Model - Milko Kosturkov - PHP UK 2022
Make PHP objects behave like JavaScript objects with JavaScript-inspired classes and syntax. Learn how to create constructors, implement inheritance, and use closures to create objects with methods.
- Make PHP objects behave like JavaScript objects
- Create a JSConstructor class that can act like a JavaScript constructor
-
Use
newkeyword to create objects -
prototypeproperty to inherit behavior - Implement inheritance between objects
- Use closures to create objects with a constructor
-
Create a magic
invokemethod to call functions on objects -
Implement a
magic getmethod to get properties on objects -
Use
thisreference to call functions in the context of the object -
Create a
JSObjectclass that extends theJSConstructorclass -
Implement a
callableproperty to create objects that can be called like functions -
Implement inheritance between objects using the
prototypechain -
Use the
newkeyword to create objects with a constructor -
Implement a
constructorproperty to create objects with a constructor -
Use the
magic callmethod to call functions on objects -
Implement a
getandsetmethod to get and set properties on objects -
Use the
thisreference to call functions in the context of the object -
Implement a
callableproperty to create objects that can be called like functions -
Implement inheritance between objects using the
prototypechain