|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2007-05-10 17:32 UTC] simon at connexon dot com
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 11:00:01 2025 UTC | 
Description: ------------ For our application we use a $db which represents the database connection object. In the class, instead of creating a new object every time, we do : global $db, which retrieves the database connection from outside the class. That works good! However, when we call that class from a soap server, for some reason it does not get the $db variable (its blank)... Reproduce code: --------------- // Code $db = new MySQL(); // class class X extends A { public function __construct($params) { global $db; $this->db = $db; $this->init($params); } Expected result: ---------------- that the global $db; in the constructor contains the db connection Actual result: -------------- blank variable