Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,885 questions

51,811 answers

573 users

How to use get_declared_classes() function to get an array with names of the declared classes in current script in PHP

1 Answer

0 votes
echo "<pre>";
print_r(get_declared_classes());
echo "</pre>";

 
 
/*
run:
 
Array
(
    [0] => stdClass
    [1] => Exception
    [2] => ErrorException
    [3] => Closure
    [4] => DateTime
    [5] => DateTimeZone
    [6] => DateInterval
    [7] => DatePeriod
    [8] => LogicException
    [9] => BadFunctionCallException
    [10] => BadMethodCallException
    [11] => DomainException
    [12] => InvalidArgumentException
    [13] => LengthException
    [14] => OutOfRangeException
    [15] => RuntimeException
    [16] => OutOfBoundsException
    [17] => OverflowException
    [18] => RangeException
    [19] => UnderflowException
    [20] => UnexpectedValueException
    [21] => RecursiveIteratorIterator
    [22] => IteratorIterator
    [23] => FilterIterator
    [24] => RecursiveFilterIterator
    [25] => CallbackFilterIterator
    [26] => RecursiveCallbackFilterIterator
    [27] => ParentIterator
    [28] => LimitIterator
    [29] => CachingIterator
    [30] => RecursiveCachingIterator
    [31] => NoRewindIterator
    [32] => AppendIterator
    [33] => InfiniteIterator
    [34] => RegexIterator
    [35] => RecursiveRegexIterator
    [36] => EmptyIterator
    [37] => RecursiveTreeIterator
    [38] => ArrayObject
    [39] => ArrayIterator
    [40] => RecursiveArrayIterator
    [41] => SplFileInfo
    [42] => DirectoryIterator
    [43] => FilesystemIterator
    [44] => RecursiveDirectoryIterator
    [45] => GlobIterator
    [46] => SplFileObject
    [47] => SplTempFileObject
    [48] => SplDoublyLinkedList
    [49] => SplQueue
    [50] => SplStack
    [51] => SplHeap
    [52] => SplMinHeap
    [53] => SplMaxHeap
    [54] => SplPriorityQueue
    [55] => SplFixedArray
    [56] => SplObjectStorage
    [57] => MultipleIterator
    [58] => ReflectionException
    [59] => Reflection
    [60] => ReflectionFunctionAbstract
    [61] => ReflectionFunction
    [62] => ReflectionParameter
    [63] => ReflectionMethod
    [64] => ReflectionClass
    [65] => ReflectionObject
    [66] => ReflectionProperty
    [67] => ReflectionExtension
    [68] => ReflectionZendExtension
    [69] => SessionHandler
    [70] => __PHP_Incomplete_Class
    [71] => php_user_filter
    [72] => Directory
    [73] => ZipArchive
    [74] => LibXMLError
    [75] => DOMException
    [76] => DOMStringList
    [77] => DOMNameList
    [78] => DOMImplementationList
    [79] => DOMImplementationSource
    [80] => DOMImplementation
    [81] => DOMNode
    [82] => DOMNameSpaceNode
    [83] => DOMDocumentFragment
    [84] => DOMDocument
    [85] => DOMNodeList
    [86] => DOMNamedNodeMap
    [87] => DOMCharacterData
    [88] => DOMAttr
    [89] => DOMElement
    [90] => DOMText
    [91] => DOMComment
    [92] => DOMTypeinfo
    [93] => DOMUserDataHandler
    [94] => DOMDomError
    [95] => DOMErrorHandler
    [96] => DOMLocator
    [97] => DOMConfiguration
    [98] => DOMCdataSection
    [99] => DOMDocumentType
    [100] => DOMNotation
    [101] => DOMEntity
    [102] => DOMEntityReference
    [103] => DOMProcessingInstruction
    [104] => DOMStringExtend
    [105] => DOMXPath
    [106] => PDOException
    [107] => PDO
    [108] => PDOStatement
    [109] => PDORow
    [110] => PharException
    [111] => Phar
    [112] => PharData
    [113] => PharFileInfo
    [114] => SimpleXMLElement
    [115] => SimpleXMLIterator
    [116] => XMLReader
    [117] => XMLWriter
    [118] => finfo
    [119] => mysqli_sql_exception
    [120] => mysqli_driver
    [121] => mysqli
    [122] => mysqli_warning
    [123] => mysqli_result
    [124] => mysqli_stmt
    [125] => SQLite3
    [126] => SQLite3Stmt
    [127] => SQLite3Result
    [128] => XSLTProcessor
)
    
*/

 



answered Mar 14, 2016 by avibootz

Related questions

...