Author: Derick Rethans (derickr)
Date: 2023-05-26T14:07:46+01:00
Commit:
https://github.com/php/web-php/commit/11243875c334f5cdf0cebdc2611bfb6d80d9b936
Raw diff:
https://github.com/php/web-php/commit/11243875c334f5cdf0cebdc2611bfb6d80d9b936.diff
Fixed PHP 8.2 deprecation warnings
Changed paths:
M include/manual-lookup.inc
M tests/run-tests.php
Diff:
diff --git a/include/manual-lookup.inc b/include/manual-lookup.inc
index 2d2a708826..573e82ae84 100644
--- a/include/manual-lookup.inc
+++ b/include/manual-lookup.inc
@@ -13,27 +13,27 @@ function tryprefix($lang, $keyword, $prefix)
$keyword = preg_replace("!\\(.*\\)!", "-", $keyword);
// Try the keyword with the prefix
- $try = "/manual/${lang}/${prefix}${keyword}.php";
+ $try = "/manual/{$lang}/{$prefix}{$keyword}.php";
if (@file_exists($_SERVER['DOCUMENT_ROOT'] . $try)) { return $try; }
// Drop out spaces, and try that keyword (if different)
$nosp = str_replace(" ", "", $keyword);
if ($nosp != $keyword) {
- $try = "/manual/${lang}/${prefix}${nosp}.php";
+ $try = "/manual/{$lang}/{$prefix}{$nosp}.php";
if (@file_exists($_SERVER['DOCUMENT_ROOT'] . $try)) { return $try; }
}
// Replace spaces with hyphens, and try that (if different)
$dasp = str_replace(" ", "-", $keyword);
if ($dasp != $keyword) {
- $try = "/manual/${lang}/${prefix}${dasp}.php";
+ $try = "/manual/{$lang}/{$prefix}{$dasp}.php";
if (@file_exists($_SERVER['DOCUMENT_ROOT'] . $try)) { return $try; }
}
// Remove hyphens (and underscores), and try that (if different)
$noul = str_replace("-", "", $keyword);
if ($noul != $keyword) {
- $try = "/manual/${lang}/${prefix}${noul}.php";
+ $try = "/manual/{$lang}/{$prefix}{$noul}.php";
if (@file_exists($_SERVER['DOCUMENT_ROOT'] . $try)) { return $try; }
}
@@ -41,7 +41,7 @@ function tryprefix($lang, $keyword, $prefix)
$keyword = urldecode($keyword);
$noul = str_replace("\\", "-", $keyword);
if ($noul != $keyword) {
- $try = "/manual/${lang}/${prefix}${noul}.php";
+ $try = "/manual/{$lang}/{$prefix}{$noul}.php";
if (@file_exists($_SERVER['DOCUMENT_ROOT'] . $try)) { return $try; }
}
@@ -52,7 +52,7 @@ function tryprefix($lang, $keyword, $prefix)
if ($pos !== false) {
$keyword[$pos] = '.';
- $try = "/manual/${lang}/${prefix}${keyword}.php";
+ $try = "/manual/{$lang}/{$prefix}{$keyword}.php";
if (@file_exists($_SERVER['DOCUMENT_ROOT'] . $try)) { return $try;
}
}
}
diff --git a/tests/run-tests.php b/tests/run-tests.php
index 1688e38565..da18b8b095 100644
--- a/tests/run-tests.php
+++ b/tests/run-tests.php
@@ -698,7 +698,7 @@ function main(): void
$environment['TEST_PHP_EXECUTABLE'] = $php;
}
- if (strlen($conf_passed)) {
+ if ($conf_passed != null) {
if (IS_WINDOWS) {
$pass_options .= " -c " . escapeshellarg($conf_passed);
} else {
@@ -2802,10 +2802,10 @@ function run_test(string $php, $file, array $env):
string
gdb --args {$cmd}
;;
"valgrind")
- USE_ZEND_ALLOC=0 valgrind $2 ${cmd}
+ USE_ZEND_ALLOC=0 valgrind $2 {$cmd}
;;
"rr")
- rr record $2 ${cmd}
+ rr record $2 {$cmd}
;;
*)
{$cmd}
@@ -3345,7 +3345,7 @@ function clear_show_test(): void
// Parallel testing
global $workerID;
- if (!$workerID) {
+ if (!$workerID && isset($line_length)) {
// Write over the last line to avoid random trailing chars on next echo
echo str_repeat(" ", $line_length), "\r";
}
--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php