aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2017-03-08 09:26:31 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2017-03-08 09:26:31 +0100
commit8e324191382297517135926331d291d21d924368 (patch)
treeffe5b76b2d55635a228f618367362994e63c0ab3
parentd43c2c06bf0e8f4a30638427df7a764cbf37fdfd (diff)
downloadConsole-8e324191382297517135926331d291d21d924368.zip
Console-8e324191382297517135926331d291d21d924368.tar.gz
Console-8e324191382297517135926331d291d21d924368.tar.bz2
Tput: Deterministic order for `name` and `desc…`.
In PHP 5.x, `list` arguments are assigned from one direction, and in PHP 7.x, the opposite direction. The consequence for us is that the array is filled with the same pairs, but not in the same order: […, 'name' => …, 'description' => …, …] vs. […, 'description' => …, 'name' => …, …] Removing `list` ensures a deterministic form in all PHP versions.
-rw-r--r--Tput.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/Tput.php b/Tput.php
index ee97e7c..9788b38 100644
--- a/Tput.php
+++ b/Tput.php
@@ -633,10 +633,10 @@ class Tput
// Names.
- $i = $headers['header_size'];
-
- list($out['name'], $out['description']) =
- explode('|', substr($data, $i, $headers['names_size'] - 1));
+ $i = $headers['header_size'];
+ $nameAndDescription = explode('|', substr($data, $i, $headers['names_size'] - 1));
+ $out['name'] = $nameAndDescription[0];
+ $out['description'] = $nameAndDescription[1];
// Booleans.
$i += $headers['names_size'];