PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » File Formats » Spreadsheet_Excel_Writer » Bug #7540

Object to int comparison gives Notice in php5

Details

Submitted2006-05-01 21:58 UTC
Fromtruth at proposaltech dot com
StatusDuplicate
PackageSpreadsheet_Excel_Writer
PHP Version5.1.2
OSSuSE
Roadmaps(Not assigned)

Comments

[2006-05-01 21:58 UTC] truth at proposaltech dot com

Description:
------------
There are a couple places where a passed
format object is compared to 0. That
isn't "notice clean" code in php 5.

Test script:
---------------
Anything involving formatting. In my local
copy, I made the following changes:

vi Spreadsheet/Excel/Writer/Worksheet.php +1233
if (is_object($format)) {

vi Spreadsheet/Excel/Writer/Worksheet.php +1686
if (!is_object($format) and $format == 0) {

(Perhaps "!is_object($format)" implies "$format == 0",
but I wasn't sure, so I played it safe.)

I haven't done an exhaustive search for object to
integer comparisons. These are just the cases I
ran into. With the above changes, the code paths
I use are all happy.

Expected result:
----------------
No notices would be nice.

Actual result:
--------------
Notices are produced.

[2006-05-09 16:08 UTC] pear dot php dot net at chsc dot dk

This is duplicate of bug #6509.