Object could not be converted to string
<p>The global variable is a class (object) already defined earlier</p>

<pre><code>class Users
{
    private $sql;

    public function __construct() {
        global $sql;
        $this-&gt;$sql = $sql;
    }
}
</code></pre>

<p>I'm trying to assign the object to a private variable in my other class (Users) so I don't have to use this line <code>global $sql;</code> through all the functions in <code>Users</code> but it's giving me this error:</p>

<p><code>Catchable fatal error: Object of class Bdcon could not be converted to string in /home/&lt;&lt;NAME&gt;&gt;/public_html/&lt;&lt;NAME&gt;&gt;/classes/class.users.php on line 8</code></p>
