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] => Brotli\Compress\Context
[159] => Brotli\UnCompress\Context
[160] => Dom\AdjacentPosition
[161] => DOMException
[162] => dom\domexception
[163] => DOMImplementation
[164] => Dom\Implementation
[165] => DOMNode
[166] => Dom\Node
[167] => DOMNameSpaceNode
[168] => Dom\NamespaceInfo
[169] => DOMDocumentFragment
[170] => Dom\DocumentFragment
[171] => Dom\Document
[172] => DOMDocument
[173] => Dom\HTMLDocument
[174] => Dom\XMLDocument
[175] => DOMNodeList
[176] => Dom\NodeList
[177] => DOMNamedNodeMap
[178] => Dom\NamedNodeMap
[179] => Dom\DtdNamedNodeMap
[180] => Dom\HTMLCollection
[181] => DOMCharacterData
[182] => Dom\CharacterData
[183] => DOMAttr
[184] => Dom\Attr
[185] => DOMElement
[186] => Dom\Element
[187] => Dom\HTMLElement
[188] => DOMText
[189] => Dom\Text
[190] => DOMComment
[191] => Dom\Comment
[192] => DOMCdataSection
[193] => Dom\CDATASection
[194] => DOMDocumentType
[195] => Dom\DocumentType
[196] => DOMNotation
[197] => Dom\Notation
[198] => DOMEntity
[199] => Dom\Entity
[200] => DOMEntityReference
[201] => Dom\EntityReference
[202] => DOMProcessingInstruction
[203] => Dom\ProcessingInstruction
[204] => DOMXPath
[205] => Dom\XPath
[206] => Dom\TokenList
[207] => finfo
[208] => GdImage
[209] => GdFont
[210] => GMP
[211] => mysqli_sql_exception
[212] => mysqli_driver
[213] => mysqli
[214] => mysqli_warning
[215] => mysqli_result
[216] => mysqli_stmt
[217] => PDOException
[218] => PDO
[219] => PDOStatement
[220] => PDORow
[221] => Pdo\Mysql
[222] => Pdo\Sqlite
[223] => PharException
[224] => Phar
[225] => PharData
[226] => PharFileInfo
[227] => SNMP
[228] => SNMPException
[229] => SoapClient
[230] => SoapVar
[231] => SoapServer
[232] => SoapFault
[233] => SoapParam
[234] => SoapHeader
[235] => Soap\Url
[236] => Soap\Sdl
[237] => Socket
[238] => AddressInfo
[239] => tidy
[240] => tidyNode
[241] => XMLReader
[242] => XMLWriter
[243] => XSLTProcessor
[244] => ZipArchive
)