Jump to content

UNSET isn't working


myrddinwylt

Recommended Posts

The following code returns this error:

 

Parse error: syntax error, unexpected T_UNSET in C:\server\websites\127.0.0.1\htdocs-ssl\cdrdownloader\includes\invoice.class.php on line 41

 

<?php
require_once './includes/tcpdf/config/lang/eng.php';
require_once './includes/tcpdf/tcpdf.php';
require_once './includes/tcpdf_invoice_lib.php';

class invoices {
private $numbers = array();
private $pdf = null;
private $billaddr = null;
    private $customers = array();
    private $customers_currentid = null;

public $cdr = array();


private $invoiceid = null;
    private $invoicedate = array();
    private $invoiceperiod = array();

    private $clients = array();


    private $batch = array();
    private $mysql = array();
    private $conn = null;

    private $invoice_output_path = "securefiles";

    function __construct($mysql,$files) {
        $this->mysql = $mysql;
        $this->files = $files;
        $date = date('mdy');
//        $date = '2009-10-01';
        $this->batch = array('lastmonthpayments'=>date('Y-m',strtotime ( '-2 month' , strtotime ( $date ) )) . '-01', 'lastmonth'=>date('Y-m',strtotime ( '-1 month' , strtotime ( $date ) )), 'lastmonthstart'=>date('Y-m',strtotime ( '-1 month' , strtotime ( $date ) )) . '-01', 'lastmonthend' => date('Y-m-j',strtotime('-1 day', strtotime(date('Y-m',strtotime ( $date )) . '-01'))),'thismonth'=>date('Y-m',strtotime($date)) . '-01','thismonthlate'=>date('Y-m',strtotime($date)) . '-20');
        $this->invoiceperiod = array($this->batch['lastmonthstart'],$this->batch['lastmonthend']);
        $this->connect();

    }

function newInvoice() {
    if(isset($this->pdf)) { unset($this->pdf); }
        if(isset($this->cdr)) { unset($this->cdr); }

        $this->pdf = new Invoice();
        $this->cdr = null;

}

?>

 

Since setting $this->pdf to NULL doesn't free it's used memory space, and "unset()" is returning an error..... ummm....  what the hell am i supposed to do  XD.  This is driving me insane.  TCPDF has a huge memory leak, but I really don't have a choice in using it, so I need to implement some garbage cleanup freeing it's memory space prior to moving on to the next record.

 

Any suggestions that will work ?

 

Thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.