From e1cca194c57cf242fd8635b2e72e11e990279c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mar=C3=ADn?= Date: Tue, 21 Mar 2023 16:10:38 +0100 Subject: [PATCH] fix: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated (#123) --- src/NXP/MathExecutor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NXP/MathExecutor.php b/src/NXP/MathExecutor.php index 84dd3d9..2a3fd72 100644 --- a/src/NXP/MathExecutor.php +++ b/src/NXP/MathExecutor.php @@ -382,8 +382,8 @@ static function($a, $b) { '%' => [static fn($a, $b) => $a % $b, 180, false], '&&' => [static fn($a, $b) => $a && $b, 100, false], '||' => [static fn($a, $b) => $a || $b, 90, false], - '==' => [static fn($a, $b) => \is_string($a) || \is_string($b) ? 0 == \strcmp($a, $b) : $a == $b, 140, false], - '!=' => [static fn($a, $b) => \is_string($a) || \is_string($b) ? 0 != \strcmp($a, $b) : $a != $b, 140, false], + '==' => [static fn($a, $b) => \is_string($a) || \is_string($b) ? 0 == \strcmp((string)$a, (string)$b) : $a == $b, 140, false], + '!=' => [static fn($a, $b) => \is_string($a) || \is_string($b) ? 0 != \strcmp((string)$a, (string)$b) : $a != $b, 140, false], '>=' => [static fn($a, $b) => $a >= $b, 150, false], '>' => [static fn($a, $b) => $a > $b, 150, false], '<=' => [static fn($a, $b) => $a <= $b, 150, false],