You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated
in vendor\phpoffice\phpword\src\PhpWord\Element\PreserveText.php at line 63
public function __construct($text = null, $fontStyle = null, $paragraphStyle = null)
...
$matches = preg_split('/({.*?})/', $this->text, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
-> preg_split parameter #3 needs to be -1 not null.
During XMLWriter->save(...): Uncaught yii\base\ErrorException: Return type of PhpOffice\PhpWord\Shared\XMLWriter::writeAttribute($name, $value) should either be compatible with XMLWriter::writeAttribute(string $name, string $value): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor\phpoffice\phpword\src\PhpWord\Shared\XMLWriter.php:174
-> add #[\ReturnTypeWillChange] attribute
Context
Please fill in your environment information:
PHP Version: 8.1
PHPWord Version: 0.18.3
The text was updated successfully, but these errors were encountered:
Describe the Bug
If I use php 8.1 this code doesn't work:
Steps to Reproduce
Please provide a code sample that reproduces the issue.
Expected Behavior
The same output that I have if I use PHP 7.4
Current Behavior
preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated
in vendor\phpoffice\phpword\src\PhpWord\Element\PreserveText.php at line 63
public function __construct($text = null, $fontStyle = null, $paragraphStyle = null)
...
$matches = preg_split('/({.*?})/', $this->text, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
-> preg_split parameter #3 needs to be -1 not null.
During XMLWriter->save(...): Uncaught yii\base\ErrorException: Return type of PhpOffice\PhpWord\Shared\XMLWriter::writeAttribute($name, $value) should either be compatible with XMLWriter::writeAttribute(string $name, string $value): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor\phpoffice\phpword\src\PhpWord\Shared\XMLWriter.php:174
-> add #[\ReturnTypeWillChange] attribute
Context
Please fill in your environment information:
The text was updated successfully, but these errors were encountered: