Skip to content

Instantly share code, notes, and snippets.

@Girgias
Created August 14, 2023 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Girgias/63d55ba1e50b580412b004046daed02b to your computer and use it in GitHub Desktop.
Save Girgias/63d55ba1e50b580412b004046daed02b to your computer and use it in GitHub Desktop.
Minimum number of class types in a PHP build
NB: 148
InternalIterator
Exception
ErrorException
Error
CompileError
ParseError
TypeError
ArgumentCountError
ValueError
ArithmeticError
DivisionByZeroError
UnhandledMatchError
Closure
Generator
ClosedGeneratorException
WeakReference
WeakMap
Attribute
ReturnTypeWillChange
AllowDynamicProperties
SensitiveParameter
SensitiveParameterValue
Override
Fiber
FiberError
stdClass
DateTime
DateTimeImmutable
DateTimeZone
DateInterval
DatePeriod
DateError
DateObjectError
DateRangeError
DateException
DateInvalidTimeZoneException
DateInvalidOperationException
DateMalformedStringException
DateMalformedIntervalStringException
DateMalformedPeriodStringException
HashContext
JsonException
Random\RandomError
Random\BrokenRandomEngineError
Random\RandomException
Random\Engine\Mt19937
Random\Engine\PcgOneseq128XslRr64
Random\Engine\Xoshiro256StarStar
Random\Engine\Secure
Random\Randomizer
Random\IntervalBoundary
ReflectionException
Reflection
ReflectionFunctionAbstract
ReflectionFunction
ReflectionGenerator
ReflectionParameter
ReflectionType
ReflectionNamedType
ReflectionUnionType
ReflectionIntersectionType
ReflectionMethod
ReflectionClass
ReflectionObject
ReflectionProperty
ReflectionClassConstant
ReflectionExtension
ReflectionZendExtension
ReflectionReference
ReflectionAttribute
ReflectionEnum
ReflectionEnumUnitCase
ReflectionEnumBackedCase
ReflectionFiber
__PHP_Incomplete_Class
AssertionError
php_user_filter
Directory
LogicException
BadFunctionCallException
BadMethodCallException
DomainException
InvalidArgumentException
LengthException
OutOfRangeException
RuntimeException
OutOfBoundsException
OverflowException
RangeException
UnderflowException
UnexpectedValueException
RecursiveIteratorIterator
IteratorIterator
FilterIterator
RecursiveFilterIterator
CallbackFilterIterator
RecursiveCallbackFilterIterator
ParentIterator
LimitIterator
CachingIterator
RecursiveCachingIterator
NoRewindIterator
AppendIterator
InfiniteIterator
RegexIterator
RecursiveRegexIterator
EmptyIterator
RecursiveTreeIterator
ArrayObject
ArrayIterator
RecursiveArrayIterator
SplFileInfo
DirectoryIterator
FilesystemIterator
RecursiveDirectoryIterator
GlobIterator
SplFileObject
SplTempFileObject
SplDoublyLinkedList
SplQueue
SplStack
SplHeap
SplMinHeap
SplMaxHeap
SplPriorityQueue
SplFixedArray
SplObjectStorage
MultipleIterator
Traversable
IteratorAggregate
Iterator
Serializable
ArrayAccess
Countable
Stringable
Throwable
UnitEnum
BackedEnum
DateTimeInterface
JsonSerializable
Random\Engine
Random\CryptoSafeEngine
Reflector
RecursiveIterator
OuterIterator
SeekableIterator
SplObserver
SplSubject
<?php
$class_types = [...get_declared_classes(), ...get_declared_interfaces(), ...get_declared_traits()];
echo "NB: ", count($class_types), PHP_EOL;
$print = function ($str) {echo $str, PHP_EOL;};
array_map($print, $class_types);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment