-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to access array offset on value of type null PHP 7.4.13 #2026
Comments
I’m dealing with similar problem. After upgrading to PHP 7.4 code
produce in log file endless lines of
|
Can either of you share the file which is causing this problem? And please confirm your version of PhpSpreadsheet. |
I hope that this could help. |
No luck duplicating your problem with read-x.php as you supplied it on any of master, 17.1, or 16.0 releases, running with PHP 7.4.14. Results in each case:
|
Hi @oleibman , Did you enable your notice error reporing? The output for read-x.php using PHP 7.4.13 is
|
I added the following statements:
And my output is now:
So, yes, I get notices, but I don't see the notices you are reporting. |
I have the same problem. My error message is: 'Trying to access array offset on value of type int' (errcode: 0). I'm calling function:
Then execution goes down to method DefaultValueBinder::dataTypeForValue. Error occurs in line:
The reason of error is that my $pValue is of type int and above line tries to use it as an array ($pValue[0]), which is not allowed for type int. In my opinion the above line should look like this:
|
That line of code was fixed in version 1.10.0, 18 months ago |
OK, my fault, sorry. I did 'composer update' before making a comment, but did not check that it stuck on version 1.9.0 because of a problem with some other dependencies. Now I have 1.18.0 and my problem is gone. Thanks. |
Has this issue been fixed now? Or any work around? |
I had an issue :
After this line:
I add with this line:
Just like this:
And this works for me. |
Same issue here with error 1. Upgrade PhpSpreadsheet 1.16 Working, no error, file readable 2. Upgrade PhpSpreadsheet 1.17 Working, no error, file readable 3. Upgrade PhpSpreadsheet 1.18 Not working, error 4. Upgrade PhpSpreadsheet 1.19 No error but file not working, impossible to open with Excel. |
I still am unable to duplicate the error, with any release, of the only file uploaded so far in connection with this problem. If you have another file with a problem, please upload it. |
Sorry @oleibman, I can't share my file and script. I make some tests. I cleared my script and deleted all cell/col/sheet in my file. I only open/write with this code:
I can open the file. I don't know if the problem is on reading or writing. |
A couple of things to add to this thread (I was experiencing the same behaviour as OP)
|
I agree with @mikevaux. I have tested with 1.20.0 and all is fine. |
Thank you for confirming that the issue is resolved. Closing it now. |
This is:
What is the expected behavior?
Read the excel file
What is the current behavior?
ErrorException : Trying to access array offset on value of type null
What are the steps to reproduce?
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load(storage_path('template.xls'));
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
Which versions of PhpSpreadsheet and PHP are affected?
PhpSpreadsheet v 1.16
PHP 7.4
The text was updated successfully, but these errors were encountered: