-
-
Notifications
You must be signed in to change notification settings - Fork 467
/
instanceoff.zep
72 lines (59 loc) · 1.08 KB
/
instanceoff.zep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
* OO operations
*/
namespace Stub;
class Instanceoff
{
public function testInstanceOf1() -> bool
{
var a;
let a = new \stdClass();
return a instanceof \stdClass;
}
public function testInstanceOf2() -> bool
{
var a;
let a = new self();
return a instanceof Instanceoff;
}
public function testInstanceOf3() -> bool
{
var a;
let a = new \stdClass();
return a instanceof UnknownClass;
}
public function testInstanceOf4(var a) -> bool
{
if a instanceof \Traversable {
return true;
}
return false;
}
public function testInstanceOf5(var a) -> bool
{
if a instanceof this {
return true;
}
return false;
}
public function testInstanceOf6() -> bool
{
var a;
let a = new static();
return a instanceof Instanceoff;
}
public function testInstanceOf7(object test) -> bool
{
return test instanceof Instanceoff;
}
public function testInstanceOf8(string test) -> bool
{
var a;
let a = new static();
return a instanceof test;
}
public function testInstanceOf9(object a, string test) -> bool
{
return a instanceof test;
}
}