Open NathanDid opened 1 year ago
This is:
The calcul of the formula =IF(FALSE, IF( LEFT( "0", 3 ) = "16-", 1, IF( OR( 1 = IF( "Le L" = "Le L", 6.89, 2 ), AND( 0.735 = 1, "0" <> "" ) ), "", 1 ) ), 3) should succeed and return 3.
=IF(FALSE, IF( LEFT( "0", 3 ) = "16-", 1, IF( OR( 1 = IF( "Le L" = "Le L", 6.89, 2 ), AND( 0.735 = 1, "0" <> "" ) ), "", 1 ) ), 3)
An exception is thrown exception [exc:PhpOffice\PhpSpreadsheet\Calculation\Exception("Worksheet!B5 -> internal error")] has been thrown.
exception [exc:PhpOffice\PhpSpreadsheet\Calculation\Exception("Worksheet!B5 -> internal error")] has been thrown.
<?php require __DIR__ . '/vendor/autoload.php'; $formulas = [ '=IF(FALSE, 3, IF( LEFT( "0", 3 ) = "16-", 1, IF( OR( 1 = IF( "Le L" = "Le L", 6.89, 2 ), AND( 0.735 = 1, "0" <> "" ) ), "", 1 ) ))', // THIS ONE WORKS '=IF(FALSE, IF( LEFT( "0", 3 ) = "16-", 1, IF( OR( 1 = IF( "Le L" = "Le L", 6.89, 2 ), AND( 0.735 = 1, "0" <> "" ) ), "", 1 ) ), 3)', // THIS NOT ]; $calculation = Calculation::getInstance(); foreach ($formulas as $formula) { $calculation->calculateFormula($formula); }
php 7.4, phpoffice/phpspreadsheet 1.29.0
Seems to be a duplicate of #3755. Leaving both open for the time being.
This is:
What is the expected behavior?
The calcul of the formula
=IF(FALSE, IF( LEFT( "0", 3 ) = "16-", 1, IF( OR( 1 = IF( "Le L" = "Le L", 6.89, 2 ), AND( 0.735 = 1, "0" <> "" ) ), "", 1 ) ), 3)
should succeed and return 3.What is the current behavior?
An exception is thrown
exception [exc:PhpOffice\PhpSpreadsheet\Calculation\Exception("Worksheet!B5 -> internal error")] has been thrown.
What are the steps to reproduce?
What features do you think are causing the issue
Which versions of PhpSpreadsheet and PHP are affected?
php 7.4, phpoffice/phpspreadsheet 1.29.0