xref: /PHP-7.4/Zend/tests/bug79022.phpt (revision f09b958e)
1--TEST--
2Bug #79022 (class_exists returns True for classes that are not ready to be used)
3--FILE--
4<?php
5function my_autoloader($class) {
6    if (class_exists('Foo', 0)) {
7		new Foo();
8    }
9	if ($class == 'Foo') {
10		eval("class Foo extends Bar{}");
11	}
12
13	if ($class == 'Bar') {
14		eval("class Bar {}");
15    }
16
17	if ($class == 'Dummy') {
18		eval ("class Dummy implements iFoo {}");
19	}
20
21
22	if (interface_exists('iFoo', 0)) {
23		new Dummy();
24	}
25	if ($class == 'iFoo') {
26		eval ("interface iFoo extends iBar {}");
27	}
28
29	if ($class == 'iBar') {
30		eval ("interface iBar {}");
31	}
32}
33spl_autoload_register('my_autoloader');
34new Foo();
35new Dummy();
36echo "okey";
37?>
38--EXPECT--
39okey
40