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?

Link to comment
Share on other sites

Problem is elsewhere.

 

Please post the error message you're receiving from the interpreter.

 

Edit:

 

Btw, this belongs in 3rd party scripts, but since it's semi OOP related I won't tell you to go post it there.

 

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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?

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.