Skip to content

Commit e674e30

Browse files
committed
test(zend): cover whitespace-free bound+default with type args (>> splitting)
Signed-off-by: azjezz <azjezz@protonmail.com>
1 parent 5bedf6f commit e674e30

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Generic syntax: bound and default both carry type arguments, closing >>
3+
--FILE--
4+
<?php
5+
class B<U> {}
6+
7+
// class A has a generic parameter T with bound B<string> and default B<int>
8+
class A<T:B<string>=B<int>> {}
9+
10+
$p = (new ReflectionClass('A'))->getGenericParameters()[0];
11+
12+
$b = $p->getBound();
13+
echo "bound: ", $b->getName(), "<", $b->getGenericArguments()[0]->getName(), ">\n";
14+
15+
$d = $p->getDefault();
16+
echo "default: ", $d->getName(), "<", $d->getGenericArguments()[0]->getName(), ">\n";
17+
?>
18+
--EXPECT--
19+
bound: B<string>
20+
default: B<int>

0 commit comments

Comments
 (0)