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