What do ā% sā and ā% dā mean in this example? This seems to be a shorthand for calling variables. Does this syntax only work in a class?
// Class class Building { // Object variables/properties private $number_of_floors = 5; // These buildings have 5 floors private $color; // Class constructor public function __construct($paint) { $this->color = $paint; } public function describe() { printf('This building has %d floors. It is %s in color.', $this->number_of_floors, $this->color ); } }
EDIT: The part that bothers me how the compiler knows which variable% d refers to? Is this done only in the order in which the member variables are declared?
source share