Re: issues movig to php5 (extending html_table)

From: Date: Mon, 03 Apr 2006 08:04:27 +0000
Subject: Re: issues movig to php5 (extending html_table)
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23512@lists.php.net to get a copy of this message
Justin Patrin wrote:
On 4/2/06, j llarens <llarensj@yahoo.com.ar> wrote:
I beggining to test php 5.0.5. I get a error using an class that extends PEAR HTML_Table, and the error happends in HTML_Table, not in the inherited class. I could not determine the cause of the error. Can somebody guide me to documentation/hints regarding to code migration related to PEAR? Or PEAR can't be used with PHP5 ?
Most of PEAR is fine with PHP5. And the problem here is not related to php5
this is the class HTML_DB_Table: <?php /* table from a query */ require_once ("HTML/Table.php"); class DB_HTML_Table extends HTML_Table { public $aColumnLinks = array(); public $aTableLinks = array(); public $sqlData; public $headers; public $isForm; public $aColTot=array(); public $aFilTot=array(); function DB_HTML_Table( $oResult, $attr, $headAttr=array(), $lForm=false ) {
     $this->sqlData = $oResult;
   
Instead of
     HTML_Common::HTML_Common($attr);
   
would better be something like:
parent::HTML_Table($attr);
} <snip>
and gives this error: Fatal error: call to a member function addRow() on a non-object in /usr/lib/php/HTML/Table.php on line 416 Which is due to the absence of the _tbody property normally instanciated by the HTML_Table constructor but never called here.
-- toggg >> >> > >This almost always means that an error happened somewhere and the code >isn't checking for the error before trying to use the object. Try >setting a global PEAR error handler. > >-- >Justin Patrin > > >

« previous php.pear.general (#23512) next »