Skip to content

Commit 7180a0a

Browse files
committed
add failing fixture zero offset, negative length
1 parent 2a1de4c commit 7180a0a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace Rector\Tests\DowngradePhp80\Rector\FuncCall\DowngradeSubstrFalsyRector\Fixture;
4+
5+
/**
6+
* @see https://3v4l.org/lv13M#v7.4.33
7+
*/
8+
class WithZeroOffsetLengthNegative
9+
{
10+
public function run(string $name)
11+
{
12+
return substr($name, 0, -1);
13+
}
14+
}
15+
16+
?>
17+
-----
18+
<?php
19+
20+
namespace Rector\Tests\DowngradePhp80\Rector\FuncCall\DowngradeSubstrFalsyRector\Fixture;
21+
22+
/**
23+
* @see https://3v4l.org/lv13M#v7.4.33
24+
*/
25+
class WithZeroOffsetLengthNegative
26+
{
27+
public function run(string $name)
28+
{
29+
return (string) substr($name, 0, -1);
30+
}
31+
}
32+
33+
?>

0 commit comments

Comments
 (0)