get_declared_classes
Description
The get_declared_classes of Class / Object for PHP returns an array with the name of the defined classes.
Syntax
get_declared_classes ( void ) : array
Return
Returns an array of the names of the declared classes in the current script.
Note: Note that depending on what extensions you have compiled or loaded into PHP, additional classes could be present. This means that you will not be able to define your own classes using these names. There is a list of predefined classes in the Predefined Classes section of the appendices.
Examples
1
<? $return = get_declared_classes(); print_r($return); ?>
Array ( [0] => InternalIterator [1] => Exception [2] => ErrorException [3] => Error [4] => CompileError [5] => ParseError [6] => TypeError [7] => ArgumentCountError [8] => ValueError [9] => ArithmeticError [10] => DivisionByZeroError [11] => UnhandledMatchError [12] => Closure [13] => Generator [14] => ClosedGeneratorException [15] => WeakReference [16] => WeakMap [17] => Attribute [18] => ReturnTypeWillChange [19] => AllowDynamicProperties [20] => SensitiveParameter [21] => SensitiveParameterValue [22] => Override [23] => Fiber [24] => FiberError [25] => stdClass [26] => DateTime [27] => DateTimeImmutable [28] => DateTimeZone [29] => DateInterval [30] => DatePeriod [31] => DateError [32] => DateObjectError [33] => DateRangeError [34] => DateException [35] => DateInvalidTimeZoneException [36] => DateInvalidOperationException [37] => DateMalformedStringException [38] => DateMalformedIntervalStringException [39] => DateMalformedPeriodStringException [40] => LibXMLError [41] => OpenSSLCertificate [42] => OpenSSLCertificateSigningRequest [43] => OpenSSLAsymmetricKey [44] => SQLite3Exception [45] => SQLite3 [46] => SQLite3Stmt [47] => SQLite3Result [48] => InflateContext [49] => DeflateContext [50] => CurlHandle [51] => CurlMultiHandle [52] => CurlShareHandle [53] => CURLFile [54] => CURLStringFile [55] => HashContext [56] => FTP\Connection [57] => JsonException [58] => LogicException [59] => BadFunctionCallException [60] => BadMethodCallException [61] => DomainException [62] => InvalidArgumentException [63] => LengthException [64] => OutOfRangeException [65] => RuntimeException [66] => OutOfBoundsException [67] => OverflowException [68] => RangeException [69] => UnderflowException [70] => UnexpectedValueException [71] => RecursiveIteratorIterator [72] => IteratorIterator [73] => FilterIterator [74] => RecursiveFilterIterator [75] => CallbackFilterIterator [76] => RecursiveCallbackFilterIterator [77] => ParentIterator [78] => LimitIterator [79] => CachingIterator [80] => RecursiveCachingIterator [81] => NoRewindIterator [82] => AppendIterator [83] => InfiniteIterator [84] => RegexIterator [85] => RecursiveRegexIterator [86] => EmptyIterator [87] => RecursiveTreeIterator [88] => ArrayObject [89] => ArrayIterator [90] => RecursiveArrayIterator [91] => SplFileInfo [92] => DirectoryIterator [93] => FilesystemIterator [94] => RecursiveDirectoryIterator [95] => GlobIterator [96] => SplFileObject [97] => SplTempFileObject [98] => SplDoublyLinkedList [99] => SplQueue [100] => SplStack [101] => SplHeap [102] => SplMinHeap [103] => SplMaxHeap [104] => SplPriorityQueue [105] => SplFixedArray [106] => SplObjectStorage [107] => MultipleIterator [108] => Random\RandomError [109] => Random\BrokenRandomEngineError [110] => Random\RandomException [111] => Random\Engine\Mt19937 [112] => Random\Engine\PcgOneseq128XslRr64 [113] => Random\Engine\Xoshiro256StarStar [114] => Random\Engine\Secure [115] => Random\Randomizer [116] => Random\IntervalBoundary [117] => ReflectionException [118] => Reflection [119] => ReflectionFunctionAbstract [120] => ReflectionFunction [121] => ReflectionGenerator [122] => ReflectionParameter [123] => ReflectionType [124] => ReflectionNamedType [125] => ReflectionUnionType [126] => ReflectionIntersectionType [127] => ReflectionMethod [128] => ReflectionClass [129] => ReflectionObject [130] => ReflectionProperty [131] => ReflectionClassConstant [132] => ReflectionExtension [133] => ReflectionZendExtension [134] => ReflectionReference [135] => ReflectionAttribute [136] => ReflectionEnum [137] => ReflectionEnumUnitCase [138] => ReflectionEnumBackedCase [139] => ReflectionFiber [140] => SessionHandler [141] => __PHP_Incomplete_Class [142] => AssertionError [143] => php_user_filter [144] => Directory [145] => Shmop [146] => SimpleXMLElement [147] => SimpleXMLIterator [148] => PhpToken [149] => XMLParser [150] => DOMException [151] => DOMImplementation [152] => DOMNode [153] => DOMNameSpaceNode [154] => DOMDocumentFragment [155] => DOMDocument [156] => DOMNodeList [157] => DOMNamedNodeMap [158] => DOMCharacterData [159] => DOMAttr [160] => DOMElement [161] => DOMText [162] => DOMComment [163] => DOMCdataSection [164] => DOMDocumentType [165] => DOMNotation [166] => DOMEntity [167] => DOMEntityReference [168] => DOMProcessingInstruction [169] => DOMXPath [170] => finfo [171] => GdImage [172] => GdFont [173] => GMP [174] => mysqli_sql_exception [175] => mysqli_driver [176] => mysqli [177] => mysqli_warning [178] => mysqli_result [179] => mysqli_stmt [180] => PDOException [181] => PDO [182] => PDOStatement [183] => PDORow [184] => PharException [185] => Phar [186] => PharData [187] => PharFileInfo [188] => Socket [189] => AddressInfo [190] => ZipArchive )