1--TEST--
2Test class_exists() function : basic functionality
3--FILE--
4<?php
5echo "*** Testing class_exists() : basic functionality ***\n";
6
7spl_autoload_register(function ($className) {
8    echo "In autoload($className)\n";
9});
10
11echo "Calling class_exists() on non-existent class with autoload explicitly enabled:\n";
12var_dump( class_exists('C', true) );
13echo "\nCalling class_exists() on existing class with autoload explicitly enabled:\n";
14var_dump( class_exists('stdclass', true) );
15
16echo "\nCalling class_exists() on non-existent class with autoload explicitly enabled:\n";
17var_dump( class_exists('D', false) );
18echo "\nCalling class_exists() on existing class with autoload explicitly disabled:\n";
19var_dump( class_exists('stdclass', false) );
20
21echo "\nCalling class_exists() on non-existent class with autoload unspecified:\n";
22var_dump( class_exists('E') );
23echo "\nCalling class_exists() on existing class with autoload unspecified:\n";
24var_dump( class_exists('stdclass') );
25
26echo "Done";
27?>
28--EXPECT--
29*** Testing class_exists() : basic functionality ***
30Calling class_exists() on non-existent class with autoload explicitly enabled:
31In autoload(C)
32bool(false)
33
34Calling class_exists() on existing class with autoload explicitly enabled:
35bool(true)
36
37Calling class_exists() on non-existent class with autoload explicitly enabled:
38bool(false)
39
40Calling class_exists() on existing class with autoload explicitly disabled:
41bool(true)
42
43Calling class_exists() on non-existent class with autoload unspecified:
44In autoload(E)
45bool(false)
46
47Calling class_exists() on existing class with autoload unspecified:
48bool(true)
49Done
50