So I got this code:
class DAO
{
private $_connect = "oci_connect";
function Conect()
{
$connect = $this->$_connect;
$connect($user, $pass, $conStr);
}
}
It works well. PHP recognizes the function stored in the object attribute, but there’s a way to simplify like this:
class DAO
{
private $_connect = "oci_connect";
function Conect()
{
$this->_connect($user, $pass, $conStr);
}
}
I want to use the object attribute instead to stock it on another variable to use it as a function. In this case PHP think that is an object method and not a variable. It’s possible to do it in other way?
Try something like this: