php -> operator used in cascade -
I saw this code: is included in a class definition. Please tell the meaning of this type of code:
public function query ($ query) {$ full_query = $ This- & gt; Link-> Query ($ query); If ($ this- & gt; link & gt; error), ($ this- & gt; link & gt; error, $ query) {$ this-> log_db_errors; return false; } And {return true; }}
A-> B-> C
I know that a-> gt
is used by a method or someone Upon reaching an immediate class property But do not understand how ("read, understand, translate") a-> gt; B-> C
This means that property property B is also an object, so you have the property A The object A's property is getting C.
class a {public $ b; Function __ conversion () {$ this- & gt; B = new B; }} Class B {public $ c; Function __ conversion () {$ this- & gt; C = 'hello'; }} $ A = new A; Revert $ a-> gt; B-> C; // output Hello
Comments
Post a Comment