1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 07:34:41 +01:00

Fixed behaviour of range function

This commit is contained in:
Daniil Gentili 2016-07-20 17:34:23 +02:00
parent 2cc6300bb5
commit 4f868e09de
2 changed files with 21 additions and 17 deletions

View File

@ -135,8 +135,12 @@ function pyjslib_range($start, $stop = null, $step = 1)
return array_reverse($arr, false);
}
if($step > 1 && $step > ($start - $stop)) {
$arr = [ $start ];
} else {
$arr = range($start, $stop, $step);
array_pop($arr);
}
return $arr;
}