How to call function by reference?
I'm not sure if I understood your question correctly, but if you want to change the stock for a product you can simply call the uc_stock_set() function (where the product is in the $node variable, and the new stock is in the $stock variable)

$stock = 5;
uc_stock_set($node-&gt;model, $stock); // sets stock to 5


Or use uc_stock_adjust() to increase or decrease the stock by a certain amount 

uc_stock_adjust($node-&gt;model, 1); // adds 1 to current stock, stock is now 6




I am assuming that you have


Installed ubercart
Activated the uc_stock module
Created a product, and set its SKU (model) to a certain value, say MODEL_1
Gone to the 'stock' tab on the edit node page of this product and activated the stock for MODEL_1


At this point we have a product, represented by a node. This product has one (or many) associated SKUs. Each SKU has an associated stock stored in the database by uc_stock.

Only once all of this is in place can we can go ahead and use the uc_stock_set and uc_stock_adjust functions.