class MyClass
{
public $var;
function __construct($ip, $login, $pass, $db)
{
$this->var = $mysql = mysqli_connect($ip, $login, $pass, $db);
}
function GetVar()
{
var_dump($this->var);
}
}
$test = MyClass("ip", "login", "pass", "db"); // Null
$test->GetVar();