Skip to content

Commit 2a3d393

Browse files
committed
Add test for & and interfaces
1 parent a612954 commit 2a3d393

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Zend/tests/pattern_matching/is/and.phpt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ And pattern
33
--FILE--
44
<?php
55

6+
interface A {}
7+
interface B {}
8+
interface C {}
9+
class Foo implements A, B {}
10+
611
var_dump(1 is (int&1));
712
var_dump(2 is (int&(1|2)));
813
var_dump(3 is (float&1));
914
var_dump(4 is (int&float));
1015
var_dump([] is ([]&[...]));
1116
var_dump('foo' is (string&'bar'));
17+
var_dump(new Foo() is (A&B));
18+
var_dump(new Foo() is (A&C));
1219

1320
?>
1421
--EXPECT--
@@ -18,3 +25,5 @@ bool(false)
1825
bool(false)
1926
bool(true)
2027
bool(false)
28+
bool(true)
29+
bool(false)

0 commit comments

Comments
 (0)