php4 code not working under php5

Discussion in 'PHP' started by falcondriver, Sep 24, 2007.

  1. #1
    hi,
    i use this php dns resolver class ( http://www.ypass.net/software/php/Net_DNS/ ), and it works under php4. however, i have to move this whole project to a php5 server. now the shit hits the fan because the guy who wrote this class back in 2002 tries to reassign $this ($this = $this->...):
    
        function Net_DNS_RR($rrdata)
        {
            if (is_string($rrdata)) {
                $this = $this->new_from_string($rrdata);
            } else if (count($rrdata) == 7) {
                list ($name, $rrtype, $rrclass, $ttl, $rdlength, $data, $offset) = $rrdata;
                $this = $this->new_from_data($name, $rrtype, $rrclass, $ttl, $rdlength, $data, $offset);
            } else {
                $this = $this->new_from_array($rrdata);
            }
        }
    
    PHP:
    does anyone know how to fix that, without rewriting everything...?
     
    falcondriver, Sep 24, 2007 IP