summaryrefslogtreecommitdiff
path: root/Zend/tests/class_alias_018.phpt
blob: b514115285374e7b1ddb7b489a8429db774b8532 (plain)
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
--TEST--
Testing class alias with is_subclass_of()
--FILE--
<?php

class foo {
}

class_alias('foo', 'bar');


class baz extends bar {
}

var_dump(is_subclass_of(new foo, 'foo'));
var_dump(is_subclass_of(new foo, 'bar'));
var_dump(is_subclass_of(new foo, 'baz'));

var_dump(is_subclass_of(new bar, 'foo'));
var_dump(is_subclass_of(new bar, 'bar'));
var_dump(is_subclass_of(new bar, 'baz'));

var_dump(is_subclass_of(new baz, 'foo'));
var_dump(is_subclass_of(new baz, 'bar'));
var_dump(is_subclass_of(new baz, 'baz'));

?>
--EXPECT--
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(true)
bool(true)
bool(false)