From b894b98a2cea409a6617a976ebe13c9a67bcf576 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Thu, 25 Jul 2019 21:18:02 +0200 Subject: [PATCH] Test fixes for PHP 7.4 stricter behaviour --- src/PhpSpreadsheet/Calculation/Calculation.php | 2 +- tests/PhpSpreadsheetTests/Custom/ComplexAssert.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index f2e6647f..fad28dc9 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -3644,7 +3644,7 @@ class Calculation } else { // it's a variable, constant, string, number or boolean // If the last entry on the stack was a : operator, then we may have a row or column range reference $testPrevOp = $stack->last(1); - if ($testPrevOp['value'] == ':') { + if ($testPrevOp !== null && $testPrevOp['value'] === ':') { $startRowColRef = $output[count($output) - 1]['value']; [$rangeWS1, $startRowColRef] = Worksheet::extractSheetTitle($startRowColRef, true); if ($rangeWS1 != '') { diff --git a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php index 762b2886..d039dab0 100644 --- a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php +++ b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php @@ -35,7 +35,7 @@ class ComplexAssert public function assertComplexEquals($expected, $actual, $delta = 0) { - if ($expected === INF || $expected[0] === '#') { + if ($expected === INF || (is_string($expected) && $expected[0] === '#')) { return $this->testExpectedExceptions($expected, $actual); }