PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.2k forks source link

PHP 7.1 - Non-numeric value encountered : stringFromColumnIndex() : Line 835 #1338

Closed seltix5 closed 6 years ago

seltix5 commented 6 years ago

Hi,

PHP is warning about a non-numeric value in the function stringFromColumnIndex() at line 835 :

https://github.com/PHPOffice/PHPExcel/blob/1.8/Classes/PHPExcel/Cell.php#L843

PHPExcel version 1.8.1

After some output, apparently this append when $pColumnIndex has the column letter as value.

Thanks.

PowerKiKi commented 6 years ago

PHP 7.1 is not, and will not be, supported. Upgrade to PhpSpreadsheet instead.

seltix5 commented 6 years ago

Hi, But this is just a warning duo to directly converting a string to a int, it could be easly fixed. PhpSpreadsheet has dependencies and uses composer, i do not :/

lbr88 commented 6 years ago

For anyone else having this problem i just added the following to the function stringFromColumnIndex in PHPExcel/Cell.php

$pColumnIndex = intval($pColumnIndex,0);

And it fixed it for my usecase. But use at your own risk.