xref: /PHP-7.0/Zend/tests/class_alias_018.phpt (revision d9d47f37)
1--TEST--
2Testing class alias with is_subclass_of()
3--FILE--
4<?php
5
6class foo {
7}
8
9class_alias('foo', 'bar');
10
11
12class baz extends bar {
13}
14
15var_dump(is_subclass_of(new foo, 'foo'));
16var_dump(is_subclass_of(new foo, 'bar'));
17var_dump(is_subclass_of(new foo, 'baz'));
18
19var_dump(is_subclass_of(new bar, 'foo'));
20var_dump(is_subclass_of(new bar, 'bar'));
21var_dump(is_subclass_of(new bar, 'baz'));
22
23var_dump(is_subclass_of(new baz, 'foo'));
24var_dump(is_subclass_of(new baz, 'bar'));
25var_dump(is_subclass_of(new baz, 'baz'));
26
27?>
28--EXPECT--
29bool(false)
30bool(false)
31bool(false)
32bool(false)
33bool(false)
34bool(false)
35bool(true)
36bool(true)
37bool(false)
38