The bind_param() method stores references to the values of the $code, $language, $official and $percent variables. The references are stored inside the $stmt object.
When you then give the variables values the $stmt object already knows where to look for the values.
We can create a class, that does this, ourselves:
class Play {
protected $reference;
public function bind( & $variable) {
$this->reference = &$variable;
}
public function show() {
echo "{$this->reference}<br>\n";
}
}
The & character is the reference operator. When you use it you get a reference to the value of another variable.
With this class we can create an object and have some fun:
$play = new Play;
$play->bind($string);
$string = 'Hello!';
$play->show();
$string = 'World!';
$play->show();