Originally posted by drew010
first you need to pass the object by reference in the function call, not the prototype and since you sent in the address of the object.
no
and i even get a notice telling me that passing vars by reference won't be supported in futre versions of php (or something similar)
if you want to have a clone of a classA object in classB, you may want to save the trouble of this method and try using extends so classB is a classA and more.
no...
at least i don't see no sense having a user-class extending my database class and a menu class extending my database class...
i have one instance of my database class, pass it to user class and menu class (where it is handled as reference of course)
$db = &new db();
$user = &new user($db);
$menu = &new menu($db);
...
$db->output_all_sql();
this way i will get all sql commands being sent to the database from within $user, $menu and of course by the script itself
this won't be possible if all the classes extend my database class since i would have several instances of database class in memory...
and by the way: doing such thing is not the reason why extend has been introduced