我搜索了 Stackoverflow 和 Google,似乎找不到列出所有 PHP 内置对象(如 DateTime)的参考(详尽或其他)。有没有人有这种性质的东西的链接,我将不胜感激,谢谢。
问问题
1320 次
2 回答
5
您可以使用get_declared_classes()
. 根据您拥有的扩展数量,可能的输出可能是:
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
)
于 2011-04-01T20:36:48.433 回答
3
于 2011-04-01T20:34:58.103 回答