linus72982
linus72982

Reputation: 1393

Reference for all of PHP's built-in Objects?

I have searched Stackoverflow and Google and can't seem to find a reference (exhaustive or otherwise) that lists all of PHP's built-in objects such as DateTime. Does anyone have any links to something of this nature, I would appreciate it, thank you.

Upvotes: 2

Views: 1371

Answers (2)

user142162
user142162

Reputation:

You can use get_declared_classes(). Depending on how many extensions you have, a possible output could be:

Array
(
    [0] => stdClass
    [1] => Exception
    [2] => ErrorException
    [3] => DateTime
    [4] => DateTimeZone
    [5] => ReflectionException
    [6] => Reflection
    [7] => ReflectionFunctionAbstract
    [8] => ReflectionFunction
    [9] => ReflectionParameter
    [10] => ReflectionMethod
    [11] => ReflectionClass
    [12] => ReflectionObject
    [13] => ReflectionProperty
    [14] => ReflectionExtension
    [15] => RecursiveIteratorIterator
    [16] => IteratorIterator
    [17] => FilterIterator
    [18] => RecursiveFilterIterator
    [19] => ParentIterator
    [20] => LimitIterator
    [21] => CachingIterator
    [22] => RecursiveCachingIterator
    [23] => NoRewindIterator
    [24] => AppendIterator
    [25] => InfiniteIterator
    [26] => RegexIterator
    [27] => RecursiveRegexIterator
    [28] => EmptyIterator
    [29] => ArrayObject
    [30] => ArrayIterator
    [31] => RecursiveArrayIterator
    [32] => SplFileInfo
    [33] => DirectoryIterator
    [34] => RecursiveDirectoryIterator
    [35] => SplFileObject
    [36] => SplTempFileObject
    [37] => LogicException
    [38] => BadFunctionCallException
    [39] => BadMethodCallException
    [40] => DomainException
    [41] => InvalidArgumentException
    [42] => LengthException
    [43] => OutOfRangeException
    [44] => RuntimeException
    [45] => OutOfBoundsException
    [46] => OverflowException
    [47] => RangeException
    [48] => UnderflowException
    [49] => UnexpectedValueException
    [50] => SplObjectStorage
    [51] => __PHP_Incomplete_Class
    [52] => php_user_filter
    [53] => Directory
)

Upvotes: 5

Related Questions