Skip to content

Commit

Permalink
Fix notice for PHP7.4 which implicitly creates value when referencing…
Browse files Browse the repository at this point in the history
… non-existing value (#146)
  • Loading branch information
rikvdh authored Sep 20, 2020
1 parent 3598d0c commit 638d446
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Cpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -2840,7 +2840,11 @@ private function addTextWithDirectives(&$text, $x, $y, $size, &$width, $justific
$y += $textLength[1];

if ($textLength[2] >= 0) {
$prev = &$result[count($result) - 1];
if (isset($result[count($result) - 1])) {
$prev = &$result[count($result) - 1];
} else {
$prev = null;
}
// when its a force break and a previous result is available
if ($textLength[3] == 0 && $prev != null && !empty($prev['text'])) {
// recover the width and position
Expand Down

0 comments on commit 638d446

Please sign in to comment.