So I ran into a problem while building a class in which I was unable to set the property of the class directly, and instead had to set it during construction. Here is an example of what I was trying to do.
class foo
{
private $con = Db::init();
public function __construct()
{
}
//continue class..
}
As you can see, I am just assigning a simple singleton PDO class to the property. This does not work, and I am forced to do the following.
class foo
{
private $con;
public function __construct()
{
$this->con = Db::init();
}
//continue class..
}
The first approach does not report any errors either. It just fails to continue execution. Any thoughts?
edit
The lack of errors may also be a Zen Cart thing.