Object unexpectedly overwritten after upgrading to PHP 4.4.1

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

My host recently upgraded to PHP 4.4.1 and I started getting notes from
clients about "call to member function on a non-object" errors.  After
investigating, I found the the object was getting overwritten, when
previously the code had worked as intended on PHP 4.3.10.

This is happening deep within a huge application, so I'm having trouble
coming up with a simple reproduce script, and would appreciate any help
or tips from others who've seen a similar problem.

Here's the guilty code segment:

$tax =& $client->getTax();


Class Order
    function setTax(&$tax) {
        if (is_a($tax,'SalesTax')) {
            $this->_tax =& $tax;
        } else {
            PEAR::raiseError('Expected Sales Tax',ERROR_OBJECT_EXPECTED);

    function setTaxId($tid) {
        if (($this->status == ORDER_QUOTE) or ($this->status ==
            if ($this->tax_id != $tid) {
                $this->tax_id = $tid;
                $this->_tax = NULL;
                $this->quotetime = NULL;
        } else {
            PEAR::raiseError('Can not change sales tax for order in

Expected Result:

$order is still an object

Actual Result:

$order is set to the value of $order->quotetime

I've checked, and $order is an object before the method call, but not
afterwards... very strange indeed

Site Timeline