We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e14c2a commit bf8fc47Copy full SHA for bf8fc47
language/generators.xml
@@ -49,20 +49,20 @@
49
<![CDATA[
50
<?php
51
function xrange($start, $limit, $step = 1) {
52
- if ($start < $limit) {
+ if ($start <= $limit) {
53
if ($step <= 0) {
54
- throw new LogicException('Step must be +ve');
+ throw new LogicException('Step must be positive');
55
}
56
57
for ($i = $start; $i <= $limit; $i += $step) {
58
yield $i;
59
60
} else {
61
if ($step >= 0) {
62
- throw new LogicException('Step must be -ve');
+ throw new LogicException('Step must be negative');
63
64
65
- for ($i = $start; $i >= $limit; $i -= $step) {
+ for ($i = $start; $i >= $limit; $i += $step) {
66
67
68
0 commit comments