I have a PHP class with a __construct() method. I pass parameters and store them in properties. Like this:
class BlogList {
private $app_config, $texts;
public function __construct($app_config, $texts) {
$this->$app_config = $app_config;
$this->$texts = $texts;
}
...
}
When I create an instance of this class I see that the logs say this:
PHP Notice: Array to string conversion in /path/to/blogList.php on line 6
I get this for both assignments in the __construct method. Both $app_config and $texts are arrays
Why is this conversion done? And how can I prevent it?