I am using PHP 5.3 and the extract() function.
Here is a simple example of a class I am building:
private api_username;
private api_password;
private api_signature;
private version = '63.0';
public function __construct($credentials) {
extract($credentials);
$this->api_username = $api_username;
}
The issue is that after the extract, I have to go one by one through the variables and assign them to the class variables.
Is there a way to extract directly to the class variables so I don't have to do the item by item assignment?