1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

List syntax (#529)

List (array destructuring) assignment should be declared using the configured syntax.
This commit is contained in:
Mathias Reker ⚡️
2023-08-29 12:20:33 +02:00
committed by GitHub
parent 1561230ae7
commit fd62baa267
3 changed files with 5 additions and 5 deletions

View File

@@ -353,13 +353,13 @@ function read_event($fp)
if (count($linearr) < 13) { return false; }
// Get components
list(
[
$day, $month, $year, $country,
$sdesc, $id, $ldesc, $url, $recur, $tipo, $sdato, $edato, $category
) = $linearr;
] = $linearr;
// Get info on recurring event
@list($recur, $recur_day) = explode(":", $recur, 2);
@[$recur, $recur_day] = explode(":", $recur, 2);
// Return with SQL-resultset like array
return [

View File

@@ -107,7 +107,7 @@ foreach ($active_branches as $major => $releases) {
krsort($releases);
foreach ((array)$releases as $release) {
$version = $release['version'];
list($major, $minor, $_) = explode('.', $version);
[$major, $minor, $_] = explode('.', $version);
$intro .= "
<li class='hero-version'><a class='hero-version-link' href='/downloads.php#v$version'>$version</a> &middot; <a class='notes' href='/ChangeLog-$major.php#$version'>Changelog</a> &middot; <a class='notes' href='/migration$major$minor'>Upgrading</a></li>\n";
}

View File

@@ -27,7 +27,7 @@ ERROR;
$sites = ["php.net", "lists.php.net"];
// Get data from the URL
list($none, $site, $token, $sender) = explode("/", $_SERVER["PATH_INFO"]);
[$none, $site, $token, $sender] = explode("/", $_SERVER["PATH_INFO"]);
// Error in input data
if ($sender == "" || strlen($token) < 32 || !isset($sites[$site])) {