Jump to content

[SOLVED] Problem with PHP 4 and 5 class difference


Murlyn

Recommended Posts

I am using the PEAR Spreadsheet_Excel_Writer class and the app that was working on an older server is not working on a server running PHP 5.  Im trying to debug the problem and one thing I am seeing right off the bat is that when I do a print on the php 4 class it displays this:

 

spreadsheet_excel_writer_worksheet Object

 

but a print of the PHP 5 class shows this:

 

Spreadsheet_Excel_Writer_Worksheet Object

 

Now is this going to matter in the big scheme of things? or is the problem elsewhere?

Problem is that it exports a blank page instead of an excel sheet. So I am not getting any errors, otherwise I might be able to track down the problem.  Im grasping at straws of why this is not working at this point.  It's a PEAR module so there are a lot of dependencies. Thankfully I have tracked the problem down to the spreadsheet writer class, but not having luck with figuring out where the problem lies at this point.  Any ideas?

 

I have attached the dump of the object, the old.txt is the one that works on a PHP 4.x server and then the new.txt is the one that does not work on the PHP 5.x server.

 

[attachment deleted by admin]

Ok I found one problem. A function is passing an object, but it's not being passed correctly on the PHP 5 server.

 

$worksheet = new Spreadsheet_Excel_Writer_Worksheet($this->_BIFF_version,
                                   $name, $index,
                                   $this->_activesheet, $this->_firstsheet,
                                   $this->_str_total, $this->_str_unique,
                                   $this->_str_table, $this->_url_format,
                                   $this->_parser);

function Spreadsheet_Excel_Writer_Worksheet($BIFF_version, $name,
                                                $index, &$activesheet,
                                                &$firstsheet, &$str_total,
                                                &$str_unique, &$str_table,
                                                &$url_format, &$parser)

 

When I echo or print_r the $url_format or the $parser variables in PHP 4 it shows the object, but in PHP 5 it is not showing the object. The variable is actually blank... thoughts?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.