class - php classes use of $game->details->something -


I do not understand what people do when they are $ game- & gt; Details- & gt; Some people can please explain it.

This code means that $ game is probably a game class Example, in which the description is within another object (only one more attribute) within the game class, and there is a feature within some detail class.

Semi-pseudo-code

  class games {public $ details; Function __ Construct () {$ this- & gt; Details = new details (); }} Class details {public $ something; Public __construct () {$ this- & gt; Some = "mike"; }} $ Game = new game (); Echo $ game- & gt; Details- & gt; some; // print mike    

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -