3v4l.org

run code in 300+ PHP versions simultaneously
<?php $serializable = array(); $sleep = array(); $wakeup = array(); foreach(get_declared_classes() as $class) { $reflection = new ReflectionClass($class); if($reflection->implementsInterface('Serializable')) { $serializable[] = $class; } if($reflection->hasMethod('__sleep')) { $sleep[] = $class; } if($reflection->hasMethod('__wakeup')) { $wakeup[] = $class; } if($reflection->hasMethod('__toString')) { $dest[] = $class; } } var_dump($sleep); var_dump($wakeup); var_dump($dest);
Output for git.master, git.master_jit
array(0) { } array(42) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(5) "Error" [3]=> string(12) "CompileError" [4]=> string(10) "ParseError" [5]=> string(9) "TypeError" [6]=> string(18) "ArgumentCountError" [7]=> string(10) "ValueError" [8]=> string(15) "ArithmeticError" [9]=> string(19) "DivisionByZeroError" [10]=> string(19) "UnhandledMatchError" [11]=> string(24) "ClosedGeneratorException" [12]=> string(10) "FiberError" [13]=> string(8) "DateTime" [14]=> string(17) "DateTimeImmutable" [15]=> string(12) "DateTimeZone" [16]=> string(12) "DateInterval" [17]=> string(10) "DatePeriod" [18]=> string(12) "DOMException" [19]=> string(13) "JsonException" [20]=> string(14) "LogicException" [21]=> string(24) "BadFunctionCallException" [22]=> string(22) "BadMethodCallException" [23]=> string(15) "DomainException" [24]=> string(24) "InvalidArgumentException" [25]=> string(15) "LengthException" [26]=> string(19) "OutOfRangeException" [27]=> string(16) "RuntimeException" [28]=> string(20) "OutOfBoundsException" [29]=> string(17) "OverflowException" [30]=> string(14) "RangeException" [31]=> string(18) "UnderflowException" [32]=> string(24) "UnexpectedValueException" [33]=> string(13) "SplFixedArray" [34]=> string(12) "PDOException" [35]=> string(18) "Random\RandomError" [36]=> string(30) "Random\BrokenRandomEngineError" [37]=> string(22) "Random\RandomException" [38]=> string(19) "ReflectionException" [39]=> string(14) "AssertionError" [40]=> string(13) "PharException" [41]=> string(13) "IntlException" } array(69) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(5) "Error" [3]=> string(12) "CompileError" [4]=> string(10) "ParseError" [5]=> string(9) "TypeError" [6]=> string(18) "ArgumentCountError" [7]=> string(10) "ValueError" [8]=> string(15) "ArithmeticError" [9]=> string(19) "DivisionByZeroError" [10]=> string(19) "UnhandledMatchError" [11]=> string(24) "ClosedGeneratorException" [12]=> string(10) "FiberError" [13]=> string(12) "DOMException" [14]=> string(13) "JsonException" [15]=> string(14) "LogicException" [16]=> string(24) "BadFunctionCallException" [17]=> string(22) "BadMethodCallException" [18]=> string(15) "DomainException" [19]=> string(24) "InvalidArgumentException" [20]=> string(15) "LengthException" [21]=> string(19) "OutOfRangeException" [22]=> string(16) "RuntimeException" [23]=> string(20) "OutOfBoundsException" [24]=> string(17) "OverflowException" [25]=> string(14) "RangeException" [26]=> string(18) "UnderflowException" [27]=> string(24) "UnexpectedValueException" [28]=> string(15) "CachingIterator" [29]=> string(24) "RecursiveCachingIterator" [30]=> string(11) "SplFileInfo" [31]=> string(17) "DirectoryIterator" [32]=> string(18) "FilesystemIterator" [33]=> string(26) "RecursiveDirectoryIterator" [34]=> string(12) "GlobIterator" [35]=> string(13) "SplFileObject" [36]=> string(17) "SplTempFileObject" [37]=> string(12) "PDOException" [38]=> string(18) "Random\RandomError" [39]=> string(30) "Random\BrokenRandomEngineError" [40]=> string(22) "Random\RandomException" [41]=> string(19) "ReflectionException" [42]=> string(26) "ReflectionFunctionAbstract" [43]=> string(18) "ReflectionFunction" [44]=> string(19) "ReflectionParameter" [45]=> string(14) "ReflectionType" [46]=> string(19) "ReflectionNamedType" [47]=> string(19) "ReflectionUnionType" [48]=> string(26) "ReflectionIntersectionType" [49]=> string(16) "ReflectionMethod" [50]=> string(15) "ReflectionClass" [51]=> string(16) "ReflectionObject" [52]=> string(18) "ReflectionProperty" [53]=> string(23) "ReflectionClassConstant" [54]=> string(19) "ReflectionExtension" [55]=> string(23) "ReflectionZendExtension" [56]=> string(19) "ReflectionAttribute" [57]=> string(14) "ReflectionEnum" [58]=> string(22) "ReflectionEnumUnitCase" [59]=> string(24) "ReflectionEnumBackedCase" [60]=> string(14) "AssertionError" [61]=> string(16) "SimpleXMLElement" [62]=> string(17) "SimpleXMLIterator" [63]=> string(13) "PharException" [64]=> string(4) "Phar" [65]=> string(8) "PharData" [66]=> string(12) "PharFileInfo" [67]=> string(8) "PhpToken" [68]=> string(13) "IntlException" }
Output for rfc.property-hooks
array(0) { } array(51) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(5) "Error" [3]=> string(12) "CompileError" [4]=> string(10) "ParseError" [5]=> string(9) "TypeError" [6]=> string(18) "ArgumentCountError" [7]=> string(10) "ValueError" [8]=> string(15) "ArithmeticError" [9]=> string(19) "DivisionByZeroError" [10]=> string(19) "UnhandledMatchError" [11]=> string(24) "ClosedGeneratorException" [12]=> string(10) "FiberError" [13]=> string(8) "DateTime" [14]=> string(17) "DateTimeImmutable" [15]=> string(12) "DateTimeZone" [16]=> string(12) "DateInterval" [17]=> string(10) "DatePeriod" [18]=> string(9) "DateError" [19]=> string(15) "DateObjectError" [20]=> string(14) "DateRangeError" [21]=> string(13) "DateException" [22]=> string(28) "DateInvalidTimeZoneException" [23]=> string(29) "DateInvalidOperationException" [24]=> string(28) "DateMalformedStringException" [25]=> string(36) "DateMalformedIntervalStringException" [26]=> string(34) "DateMalformedPeriodStringException" [27]=> string(12) "DOMException" [28]=> string(13) "JsonException" [29]=> string(14) "LogicException" [30]=> string(24) "BadFunctionCallException" [31]=> string(22) "BadMethodCallException" [32]=> string(15) "DomainException" [33]=> string(24) "InvalidArgumentException" [34]=> string(15) "LengthException" [35]=> string(19) "OutOfRangeException" [36]=> string(16) "RuntimeException" [37]=> string(20) "OutOfBoundsException" [38]=> string(17) "OverflowException" [39]=> string(14) "RangeException" [40]=> string(18) "UnderflowException" [41]=> string(24) "UnexpectedValueException" [42]=> string(13) "SplFixedArray" [43]=> string(12) "PDOException" [44]=> string(18) "Random\RandomError" [45]=> string(30) "Random\BrokenRandomEngineError" [46]=> string(22) "Random\RandomException" [47]=> string(19) "ReflectionException" [48]=> string(14) "AssertionError" [49]=> string(13) "PharException" [50]=> string(13) "IntlException" } array(78) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(5) "Error" [3]=> string(12) "CompileError" [4]=> string(10) "ParseError" [5]=> string(9) "TypeError" [6]=> string(18) "ArgumentCountError" [7]=> string(10) "ValueError" [8]=> string(15) "ArithmeticError" [9]=> string(19) "DivisionByZeroError" [10]=> string(19) "UnhandledMatchError" [11]=> string(24) "ClosedGeneratorException" [12]=> string(10) "FiberError" [13]=> string(9) "DateError" [14]=> string(15) "DateObjectError" [15]=> string(14) "DateRangeError" [16]=> string(13) "DateException" [17]=> string(28) "DateInvalidTimeZoneException" [18]=> string(29) "DateInvalidOperationException" [19]=> string(28) "DateMalformedStringException" [20]=> string(36) "DateMalformedIntervalStringException" [21]=> string(34) "DateMalformedPeriodStringException" [22]=> string(12) "DOMException" [23]=> string(13) "JsonException" [24]=> string(14) "LogicException" [25]=> string(24) "BadFunctionCallException" [26]=> string(22) "BadMethodCallException" [27]=> string(15) "DomainException" [28]=> string(24) "InvalidArgumentException" [29]=> string(15) "LengthException" [30]=> string(19) "OutOfRangeException" [31]=> string(16) "RuntimeException" [32]=> string(20) "OutOfBoundsException" [33]=> string(17) "OverflowException" [34]=> string(14) "RangeException" [35]=> string(18) "UnderflowException" [36]=> string(24) "UnexpectedValueException" [37]=> string(15) "CachingIterator" [38]=> string(24) "RecursiveCachingIterator" [39]=> string(11) "SplFileInfo" [40]=> string(17) "DirectoryIterator" [41]=> string(18) "FilesystemIterator" [42]=> string(26) "RecursiveDirectoryIterator" [43]=> string(12) "GlobIterator" [44]=> string(13) "SplFileObject" [45]=> string(17) "SplTempFileObject" [46]=> string(12) "PDOException" [47]=> string(18) "Random\RandomError" [48]=> string(30) "Random\BrokenRandomEngineError" [49]=> string(22) "Random\RandomException" [50]=> string(19) "ReflectionException" [51]=> string(26) "ReflectionFunctionAbstract" [52]=> string(18) "ReflectionFunction" [53]=> string(19) "ReflectionParameter" [54]=> string(14) "ReflectionType" [55]=> string(19) "ReflectionNamedType" [56]=> string(19) "ReflectionUnionType" [57]=> string(26) "ReflectionIntersectionType" [58]=> string(16) "ReflectionMethod" [59]=> string(15) "ReflectionClass" [60]=> string(16) "ReflectionObject" [61]=> string(18) "ReflectionProperty" [62]=> string(23) "ReflectionClassConstant" [63]=> string(19) "ReflectionExtension" [64]=> string(23) "ReflectionZendExtension" [65]=> string(19) "ReflectionAttribute" [66]=> string(14) "ReflectionEnum" [67]=> string(22) "ReflectionEnumUnitCase" [68]=> string(24) "ReflectionEnumBackedCase" [69]=> string(14) "AssertionError" [70]=> string(16) "SimpleXMLElement" [71]=> string(17) "SimpleXMLIterator" [72]=> string(13) "PharException" [73]=> string(4) "Phar" [74]=> string(8) "PharData" [75]=> string(12) "PharFileInfo" [76]=> string(8) "PhpToken" [77]=> string(13) "IntlException" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.01 ms | 412 KiB | 8 Q