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] => RequestParseBodyException [13] => Closure [14] => Generator [15] => ClosedGeneratorException [16] => WeakReference [17] => WeakMap [18] => Attribute [19] => ReturnTypeWillChange [20] => AllowDynamicProperties [21] => SensitiveParameter [22] => SensitiveParameterValue [23] => Override [24] => Deprecated [25] => Fiber [26] => FiberError [27] => stdClass [28] => DateTime [29] => DateTimeImmutable [30] => DateTimeZone [31] => DateInterval [32] => DatePeriod [33] => DateError [34] => DateObjectError [35] => DateRangeError [36] => DateException [37] => DateInvalidTimeZoneException [38] => DateInvalidOperationException [39] => DateMalformedStringException [40] => DateMalformedIntervalStringException [41] => DateMalformedPeriodStringException [42] => LibXMLError [43] => OpenSSLCertificate [44] => OpenSSLCertificateSigningRequest [45] => OpenSSLAsymmetricKey [46] => SQLite3Exception [47] => SQLite3 [48] => SQLite3Stmt [49] => SQLite3Result [50] => InflateContext [51] => DeflateContext [52] => CurlHandle [53] => CurlMultiHandle [54] => CurlShareHandle [55] => CURLFile [56] => CURLStringFile [57] => JsonException [58] => FTP\Connection [59] => HashContext [60] => LogicException [61] => BadFunctionCallException [62] => BadMethodCallException [63] => DomainException [64] => InvalidArgumentException [65] => LengthException [66] => OutOfRangeException [67] => RuntimeException [68] => OutOfBoundsException [69] => OverflowException [70] => RangeException [71] => UnderflowException [72] => UnexpectedValueException [73] => RecursiveIteratorIterator [74] => IteratorIterator [75] => FilterIterator [76] => RecursiveFilterIterator [77] => CallbackFilterIterator [78] => RecursiveCallbackFilterIterator [79] => ParentIterator [80] => LimitIterator [81] => CachingIterator [82] => RecursiveCachingIterator [83] => NoRewindIterator [84] => AppendIterator [85] => InfiniteIterator [86] => RegexIterator [87] => RecursiveRegexIterator [88] => EmptyIterator [89] => RecursiveTreeIterator [90] => ArrayObject [91] => ArrayIterator [92] => RecursiveArrayIterator [93] => SplFileInfo [94] => DirectoryIterator [95] => FilesystemIterator [96] => RecursiveDirectoryIterator [97] => GlobIterator [98] => SplFileObject [99] => SplTempFileObject [100] => SplDoublyLinkedList [101] => SplQueue [102] => SplStack [103] => SplHeap [104] => SplMinHeap [105] => SplMaxHeap [106] => SplPriorityQueue [107] => SplFixedArray [108] => SplObjectStorage [109] => MultipleIterator [110] => Pcntl\QosClass [111] => Random\RandomError [112] => Random\BrokenRandomEngineError [113] => Random\RandomException [114] => Random\Engine\Mt19937 [115] => Random\Engine\PcgOneseq128XslRr64 [116] => Random\Engine\Xoshiro256StarStar [117] => Random\Engine\Secure [118] => Random\Randomizer [119] => Random\IntervalBoundary [120] => ReflectionException [121] => Reflection [122] => ReflectionFunctionAbstract [123] => ReflectionFunction [124] => ReflectionGenerator [125] => ReflectionParameter [126] => ReflectionType [127] => ReflectionNamedType [128] => ReflectionUnionType [129] => ReflectionIntersectionType [130] => ReflectionMethod [131] => ReflectionClass [132] => ReflectionObject [133] => ReflectionProperty [134] => ReflectionClassConstant [135] => ReflectionExtension [136] => ReflectionZendExtension [137] => ReflectionReference [138] => ReflectionAttribute [139] => ReflectionEnum [140] => ReflectionEnumUnitCase [141] => ReflectionEnumBackedCase [142] => ReflectionFiber [143] => ReflectionConstant [144] => PropertyHookType [145] => SessionHandler [146] => __PHP_Incomplete_Class [147] => AssertionError [148] => RoundingMode [149] => php_user_filter [150] => StreamBucket [151] => Directory [152] => Shmop [153] => SimpleXMLElement [154] => SimpleXMLIterator [155] => PhpToken [156] => XMLParser [157] => BcMath\Number [158] => Dom\AdjacentPosition [159] => DOMException [160] => dom\domexception [161] => DOMImplementation [162] => Dom\Implementation [163] => DOMNode [164] => Dom\Node [165] => DOMNameSpaceNode [166] => Dom\NamespaceInfo [167] => DOMDocumentFragment [168] => Dom\DocumentFragment [169] => Dom\Document [170] => DOMDocument [171] => Dom\HTMLDocument [172] => Dom\XMLDocument [173] => DOMNodeList [174] => Dom\NodeList [175] => DOMNamedNodeMap [176] => Dom\NamedNodeMap [177] => Dom\DtdNamedNodeMap [178] => Dom\HTMLCollection [179] => DOMCharacterData [180] => Dom\CharacterData [181] => DOMAttr [182] => Dom\Attr [183] => DOMElement [184] => Dom\Element [185] => Dom\HTMLElement [186] => DOMText [187] => Dom\Text [188] => DOMComment [189] => Dom\Comment [190] => DOMCdataSection [191] => Dom\CDATASection [192] => DOMDocumentType [193] => Dom\DocumentType [194] => DOMNotation [195] => Dom\Notation [196] => DOMEntity [197] => Dom\Entity [198] => DOMEntityReference [199] => Dom\EntityReference [200] => DOMProcessingInstruction [201] => Dom\ProcessingInstruction [202] => DOMXPath [203] => Dom\XPath [204] => Dom\TokenList [205] => finfo [206] => GdImage [207] => GdFont [208] => GMP [209] => mysqli_sql_exception [210] => mysqli_driver [211] => mysqli [212] => mysqli_warning [213] => mysqli_result [214] => mysqli_stmt [215] => PDOException [216] => PDO [217] => PDOStatement [218] => PDORow [219] => Pdo\Mysql [220] => Pdo\Sqlite [221] => PharException [222] => Phar [223] => PharData [224] => PharFileInfo [225] => SNMP [226] => SNMPException [227] => SoapClient [228] => SoapVar [229] => SoapServer [230] => SoapFault [231] => SoapParam [232] => SoapHeader [233] => Soap\Url [234] => Soap\Sdl [235] => Socket [236] => AddressInfo [237] => tidy [238] => tidyNode [239] => XMLReader [240] => XMLWriter [241] => XSLTProcessor [242] => ZipArchive )