Skip to content

Commit 68f5063

Browse files
committed
add alias tests
1 parent a505fe5 commit 68f5063

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
aliases cannot escape
3+
--FILE--
4+
<?php
5+
6+
class Outer {
7+
private class Inner {}
8+
}
9+
10+
class_alias(Outer\Inner::class, 'InnerAlias');
11+
12+
new InnerAlias();
13+
?>
14+
--EXPECTF--
15+
Fatal error: Uncaught TypeError: Cannot instantiate class Outer\Inner from the global scope in %s:%d
16+
Stack trace:
17+
#0 {main}
18+
thrown in %s on line %d

0 commit comments

Comments
 (0)