Skip to content

Commit 2247c69

Browse files
committed
add test for mixed __toString()
1 parent e0c3a4f commit 2247c69

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace BugToStringType;
4+
5+
class ParentClassWithToStringMixedReturn
6+
{
7+
public function __toString()
8+
{
9+
return 'a';
10+
}
11+
}
12+
13+
class WithParentMixedReturn extends ParentClassWithToStringMixedReturn
14+
{
15+
public function __toString()
16+
{
17+
return 'value';
18+
}
19+
}
20+
21+
class Consumer extends WithParentMixedReturn
22+
{
23+
public function __toString()
24+
{
25+
return 'value';
26+
}
27+
}
28+
29+
function test(Consumer $test): void
30+
{
31+
assertType('mixed', $test->__toString());
32+
}

0 commit comments

Comments
 (0)