Tests should use new array syntax.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-03-21 17:33:40 +01:00
parent 075d2f0963
commit ab09ba6943
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 4 additions and 4 deletions

View File

@ -3,9 +3,9 @@ class Program {
private string num2Roman(int $num) {
int $n = intval($num);
string $result = '';
int[] $lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,
int[] $lookup = {'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,
'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40,
'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1);
'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1};
int $matches;
foreach($lookup as $roman => $value) {

View File

@ -2,7 +2,7 @@ class Unicode {
public string unicon(string $str, bool $to_uni = true) {
string $cpp;
string[] $cp = array('А' => 'А', 'а' => 'а',
string[] $cp = {'А' => 'А', 'а' => 'а',
"Б" => "Б", "б" => "б",
"В" => "В", "в" => "в",
"Г" => "Г", "г" => "г",
@ -34,7 +34,7 @@ class Unicode {
"Ь" => "Ь", "ь" => "ь",
"Э" => "Э", "э" => "э",
"Ю" => "Ю", "ю" => "ю",
"Я" => "Я", "я" => "я");
"Я" => "Я", "я" => "я"};
if($to_uni) {
$str = strtr($str, $cp);
} else {