-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Illegal string offset warning in PHP 7 #927
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
Comments
I've just downloaded PHPWord 0.13.0 via Composer and it's still an empty string instead of an empty array there. Not merged into a release? |
I've just downloaded PHPWord 0.13.0 via Composer still get the problem. |
had same error on PHP 7.1.2 BUT :
WORK FOR ME |
@thibaultvanc can you expand on where you implemented this? currently getting the same error on php 7.1.2 |
Doc file created successfully Warning: Illegal string offset 'w:compatSetting' in C:\xampp\htdocs\greek\vendor\phpoffice\phpword\src\PhpWord\Writer\Word2007\Part\Settings.php on line 173 Notice: Array to string conversion in C:\xampp\htdocs\greek\vendor\phpoffice\phpword\src\PhpWord\Writer\Word2007\Part\Settings.php on line 173 Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\greek\vendor\phpoffice\phpword\src\PhpWord\Writer\Word2007\Part\Settings.php on line 80 |
Still have problem today |
Same issue here. PHP 7.1.3 |
This has been merged into the Your best bet is to fork the |
Still, when I add this in composer.json:
And run this (word.patch is a file with content of the patch from the commit above):
It still returns the error:
|
Ok, try $ composer require phpoffice/phpword:dev-develop
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Updating phpoffice/phpword (dev-master 0a3f873 => dev-develop 4decaff): Checking out 4decaffd53 There are still many things I don’t know about |
dev-develop did the trick! Now it's time to wait for 0.14 release |
Change en file... PHPOffice\PHPWord\Writer\Word2007\Part\Settings private function getSettings()
Updated to private function getSettings()
|
Times change, generations replace each other. And they still fight their formidable foe. The two single quotes keep the upper hand in the php-development battle. |
its work for me, thanks |
Saving a document triggers an
Illegal string offset 'w:compatSetting'
warning, because$this->settings['w:compat']
is initialized as an empty string instead of an empty array insrc/PhpWord/Writer/Word2007/Part/Settings.php
. This appears to be the case with PHP7 — PHP5 does not raise the warning.The text was updated successfully, but these errors were encountered: