Answer the question
In order to leave comments, you need to log in
What is the problem with implicit behavior when creating two instances of the same class?
class someClass
{
private $prefix = 'prefix_';
private $str;
function __construct($data)
{
$this->str = $this->prefix.$data;
var_dump($this);
}
}
//Это в другом файле соответственно
$one = new someClass('data');
$two = new someClass('AnotherData');
Answer the question
In order to leave comments, you need to log in
require_once includes the file only once, on the second call the file is not included and $$config does not exist
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question