Thanks for your tutorial, i was looking forward to seeing getters and setter special function being called in a property-like manner instead of being called like a method. For example, in JavaScript, a setter named "color" would be called this way: Obj.color = "red", which would set a private property member (e.g. fontColor) that needs the set value, instead of Obj.color("red"). The getter as well would be called the same way but without assignment, that is: Obj.color. The getter and setter functions are special because they are used internally by the language kernel, and not in application level. This automatically means that PHP has no getter and setter function. Any other public method could be used to implement the getRating() and setrating() functionality. If this doesn't exist in PHP, then PHP is backward in this OOP feature, they should implement it.
I understand it now. Kinda got confused when you had a property called $rating and you create an argument for setrating calling it $rating also. but maybe its just me that didn't get the whole arguments passing into function idea yet.
amazingly clear explanation. Thank you so much Mike, You are awesome.
Could you please expand this series and teach about magic methods, encapsulation, polymorphism and other advanced topics?
Very good explanation!
Excellent! This is the explanation I was looking for.
Thank you so much mike
amazing video!
great explanation, thank you
Thanks for your tutorial, i was looking forward to seeing getters and setter special function being called in a property-like manner instead of being called like a method.
For example, in JavaScript, a setter named "color" would be called this way: Obj.color = "red", which would set a private property member (e.g. fontColor) that needs the set value, instead of Obj.color("red"). The getter as well would be called the same way but without assignment, that is: Obj.color.
The getter and setter functions are special because they are used internally by the language kernel, and not in application level. This automatically means that PHP has no getter and setter function. Any other public method could be used to implement the getRating() and setrating() functionality.
If this doesn't exist in PHP, then PHP is backward in this OOP feature, they should implement it.
Though there is a public function __set() {} and public function __get() {} available for any class.
your tutorials are great :)
Does anyone know which Atom package needs to be installed in order to get the error output on the browser? like here: 6:18
that error is from php, not by IDE. any IDE will work. even simple notepad
It deosn't works with me the first code it didn'e print anything
I understand it now. Kinda got confused when you had a property called $rating and you create an argument for setrating calling it $rating also. but maybe its just me that didn't get the whole arguments passing into function idea yet.
even though I changed it to private I could still edit and display the rating
1:50 there are some other ratings. 😅