summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-01 17:28:01 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-01 17:28:01 +0200
commit9ab5c28c8b35b230cf5e838d1e404e0f30f05737 (patch)
tree3a37fbc1b0af76dfd928aa478c478481a9d5f004 /Zend
parent017e2939927ae4a9f1b27da08aeb0d7d445ce4d6 (diff)
parent0dfca74be21125ae5a6e5735b8b52adc8825d6e7 (diff)
downloadphp-git-9ab5c28c8b35b230cf5e838d1e404e0f30f05737.tar.gz
Merge branch 'PHP-7.4'
Diffstat (limited to 'Zend')
-rw-r--r--Zend/tests/runtime_compile_time_binary_operands.phpt11
1 files changed, 7 insertions, 4 deletions
diff --git a/Zend/tests/runtime_compile_time_binary_operands.phpt b/Zend/tests/runtime_compile_time_binary_operands.phpt
index 897ce3e1a5..afced7af0c 100644
--- a/Zend/tests/runtime_compile_time_binary_operands.phpt
+++ b/Zend/tests/runtime_compile_time_binary_operands.phpt
@@ -108,16 +108,16 @@ function prepareLine($op1, $op2, $cmp, $operator) {
$error = "echo '" . addcslashes("$op1_p $operator $op2_p", "\\'") . '\', "\n"; $f++;';
$compare = "@($op1_p $operator $op2_p)";
- $line = "\$c++; try { ";
+ $line = "\$c++; ";
try {
$result = makeParam($cmp());
- $line .= "if (" . ($result === "(NAN)" ? "!is_nan($compare)" : "$compare !== $result") . ") { $error } } catch (Error \$e) { $error }";
+ $line .= "if (" . ($result === "(NAN)" ? "!is_nan($compare)" : "$compare !== $result") . ") { $error }";
} catch (Error $e) {
if (get_class($e) == "Error") {
return "// exempt $op1_p $operator $op2_p from checking, it generates a compile time error";
}
$msg = makeParam($e->getMessage());
- $line .= "$compare; $error } catch (Error \$e) { if (\$e->getMessage() !== $msg) { $error } }";
+ $line .= "try { $compare; $error } catch (Error \$e) { if (\$e->getMessage() !== $msg) { $error } }";
}
return $line;
}
@@ -130,7 +130,10 @@ fwrite($file, "<?php\n");
foreach ($input as $left) {
foreach ($input as $right) {
foreach ($operands as $operand) {
- fwrite($file, prepareLine($left, $right, function() use ($left, $right, $operand) { return eval("return @(\$left $operand \$right);"); }, $operand) . "\n");
+ $line = prepareLine($left, $right, function() use ($left, $right, $operand) {
+ return eval("return @(\$left $operand \$right);");
+ }, $operand);
+ fwrite($file, $line . "\n");
}
}
}