3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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; } } var_dump($sleep); var_dump($wakeup);
based on XpD3L
Output for 7.1.0 - 7.2.0
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(37) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(5) "Error" [3]=> string(10) "ParseError" [4]=> string(9) "TypeError" [5]=> string(18) "ArgumentCountError" [6]=> string(15) "ArithmeticError" [7]=> string(19) "DivisionByZeroError" [8]=> string(9) "Generator" [9]=> string(24) "ClosedGeneratorException" [10]=> string(8) "DateTime" [11]=> string(17) "DateTimeImmutable" [12]=> string(12) "DateTimeZone" [13]=> string(12) "DateInterval" [14]=> string(10) "DatePeriod" [15]=> string(12) "DOMException" [16]=> string(14) "LogicException" [17]=> string(24) "BadFunctionCallException" [18]=> string(22) "BadMethodCallException" [19]=> string(15) "DomainException" [20]=> string(24) "InvalidArgumentException" [21]=> string(15) "LengthException" [22]=> string(19) "OutOfRangeException" [23]=> string(16) "RuntimeException" [24]=> string(20) "OutOfBoundsException" [25]=> string(17) "OverflowException" [26]=> string(14) "RangeException" [27]=> string(18) "UnderflowException" [28]=> string(24) "UnexpectedValueException" [29]=> string(13) "SplFixedArray" [30]=> string(12) "PDOException" [31]=> string(3) "PDO" [32]=> string(12) "PDOStatement" [33]=> string(19) "ReflectionException" [34]=> string(14) "AssertionError" [35]=> string(13) "PharException" [36]=> string(13) "IntlException" }
Output for 7.0.6 - 7.0.20
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(36) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(5) "Error" [3]=> string(10) "ParseError" [4]=> string(9) "TypeError" [5]=> string(15) "ArithmeticError" [6]=> string(19) "DivisionByZeroError" [7]=> string(9) "Generator" [8]=> string(24) "ClosedGeneratorException" [9]=> string(8) "DateTime" [10]=> string(17) "DateTimeImmutable" [11]=> string(12) "DateTimeZone" [12]=> string(12) "DateInterval" [13]=> string(10) "DatePeriod" [14]=> string(12) "DOMException" [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(13) "SplFixedArray" [29]=> string(12) "PDOException" [30]=> string(3) "PDO" [31]=> string(12) "PDOStatement" [32]=> string(19) "ReflectionException" [33]=> string(14) "AssertionError" [34]=> string(13) "PharException" [35]=> string(13) "IntlException" }
Output for 7.0.5
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(35) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(5) "Error" [3]=> string(10) "ParseError" [4]=> string(9) "TypeError" [5]=> string(15) "ArithmeticError" [6]=> string(19) "DivisionByZeroError" [7]=> string(9) "Generator" [8]=> string(24) "ClosedGeneratorException" [9]=> string(8) "DateTime" [10]=> string(17) "DateTimeImmutable" [11]=> string(12) "DateTimeZone" [12]=> string(12) "DateInterval" [13]=> string(10) "DatePeriod" [14]=> string(12) "DOMException" [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(13) "SplFixedArray" [29]=> string(12) "PDOException" [30]=> string(3) "PDO" [31]=> string(12) "PDOStatement" [32]=> string(19) "ReflectionException" [33]=> string(14) "AssertionError" [34]=> string(13) "PharException" }
Output for 7.0.0 - 7.0.4
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(36) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(5) "Error" [3]=> string(10) "ParseError" [4]=> string(9) "TypeError" [5]=> string(15) "ArithmeticError" [6]=> string(19) "DivisionByZeroError" [7]=> string(9) "Generator" [8]=> string(24) "ClosedGeneratorException" [9]=> string(8) "DateTime" [10]=> string(17) "DateTimeImmutable" [11]=> string(12) "DateTimeZone" [12]=> string(12) "DateInterval" [13]=> string(10) "DatePeriod" [14]=> string(12) "DOMException" [15]=> string(13) "IntlException" [16]=> string(14) "LogicException" [17]=> string(24) "BadFunctionCallException" [18]=> string(22) "BadMethodCallException" [19]=> string(15) "DomainException" [20]=> string(24) "InvalidArgumentException" [21]=> string(15) "LengthException" [22]=> string(19) "OutOfRangeException" [23]=> string(16) "RuntimeException" [24]=> string(20) "OutOfBoundsException" [25]=> string(17) "OverflowException" [26]=> string(14) "RangeException" [27]=> string(18) "UnderflowException" [28]=> string(24) "UnexpectedValueException" [29]=> string(13) "SplFixedArray" [30]=> string(12) "PDOException" [31]=> string(3) "PDO" [32]=> string(12) "PDOStatement" [33]=> string(19) "ReflectionException" [34]=> string(14) "AssertionError" [35]=> string(13) "PharException" }
Output for 5.5.28, 5.5.35, 5.6.12, 5.6.21 - 5.6.28
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(29) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(9) "Generator" [3]=> string(8) "DateTime" [4]=> string(17) "DateTimeImmutable" [5]=> string(12) "DateTimeZone" [6]=> string(12) "DateInterval" [7]=> string(10) "DatePeriod" [8]=> string(12) "DOMException" [9]=> string(14) "LogicException" [10]=> string(24) "BadFunctionCallException" [11]=> string(22) "BadMethodCallException" [12]=> string(15) "DomainException" [13]=> string(24) "InvalidArgumentException" [14]=> string(15) "LengthException" [15]=> string(19) "OutOfRangeException" [16]=> string(16) "RuntimeException" [17]=> string(20) "OutOfBoundsException" [18]=> string(17) "OverflowException" [19]=> string(14) "RangeException" [20]=> string(18) "UnderflowException" [21]=> string(24) "UnexpectedValueException" [22]=> string(13) "SplFixedArray" [23]=> string(12) "PDOException" [24]=> string(3) "PDO" [25]=> string(12) "PDOStatement" [26]=> string(19) "ReflectionException" [27]=> string(13) "PharException" [28]=> string(13) "IntlException" }
Output for 5.5.29 - 5.5.30, 5.5.34, 5.6.13 - 5.6.15, 5.6.20
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(28) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(9) "Generator" [3]=> string(8) "DateTime" [4]=> string(17) "DateTimeImmutable" [5]=> string(12) "DateTimeZone" [6]=> string(12) "DateInterval" [7]=> string(10) "DatePeriod" [8]=> string(12) "DOMException" [9]=> string(14) "LogicException" [10]=> string(24) "BadFunctionCallException" [11]=> string(22) "BadMethodCallException" [12]=> string(15) "DomainException" [13]=> string(24) "InvalidArgumentException" [14]=> string(15) "LengthException" [15]=> string(19) "OutOfRangeException" [16]=> string(16) "RuntimeException" [17]=> string(20) "OutOfBoundsException" [18]=> string(17) "OverflowException" [19]=> string(14) "RangeException" [20]=> string(18) "UnderflowException" [21]=> string(24) "UnexpectedValueException" [22]=> string(13) "SplFixedArray" [23]=> string(12) "PDOException" [24]=> string(3) "PDO" [25]=> string(12) "PDOStatement" [26]=> string(19) "ReflectionException" [27]=> string(13) "PharException" }
Output for 5.5.31 - 5.5.33, 5.6.16 - 5.6.19
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(29) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(9) "Generator" [3]=> string(8) "DateTime" [4]=> string(17) "DateTimeImmutable" [5]=> string(12) "DateTimeZone" [6]=> string(12) "DateInterval" [7]=> string(10) "DatePeriod" [8]=> string(12) "DOMException" [9]=> string(13) "IntlException" [10]=> string(14) "LogicException" [11]=> string(24) "BadFunctionCallException" [12]=> string(22) "BadMethodCallException" [13]=> string(15) "DomainException" [14]=> string(24) "InvalidArgumentException" [15]=> string(15) "LengthException" [16]=> string(19) "OutOfRangeException" [17]=> string(16) "RuntimeException" [18]=> string(20) "OutOfBoundsException" [19]=> string(17) "OverflowException" [20]=> string(14) "RangeException" [21]=> string(18) "UnderflowException" [22]=> string(24) "UnexpectedValueException" [23]=> string(13) "SplFixedArray" [24]=> string(12) "PDOException" [25]=> string(3) "PDO" [26]=> string(12) "PDOStatement" [27]=> string(19) "ReflectionException" [28]=> string(13) "PharException" }
Output for 5.5.24 - 5.5.27, 5.6.8 - 5.6.11
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(9) { [0]=> string(9) "Generator" [1]=> string(8) "DateTime" [2]=> string(17) "DateTimeImmutable" [3]=> string(12) "DateTimeZone" [4]=> string(12) "DateInterval" [5]=> string(10) "DatePeriod" [6]=> string(13) "SplFixedArray" [7]=> string(3) "PDO" [8]=> string(12) "PDOStatement" }
Output for 5.4.44 - 5.4.45
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(25) { [0]=> string(9) "Exception" [1]=> string(14) "ErrorException" [2]=> string(8) "DateTime" [3]=> string(12) "DateInterval" [4]=> string(10) "DatePeriod" [5]=> string(12) "DOMException" [6]=> string(14) "LogicException" [7]=> string(24) "BadFunctionCallException" [8]=> string(22) "BadMethodCallException" [9]=> string(15) "DomainException" [10]=> string(24) "InvalidArgumentException" [11]=> string(15) "LengthException" [12]=> string(19) "OutOfRangeException" [13]=> string(16) "RuntimeException" [14]=> string(20) "OutOfBoundsException" [15]=> string(17) "OverflowException" [16]=> string(14) "RangeException" [17]=> string(18) "UnderflowException" [18]=> string(24) "UnexpectedValueException" [19]=> string(13) "SplFixedArray" [20]=> string(12) "PDOException" [21]=> string(3) "PDO" [22]=> string(12) "PDOStatement" [23]=> string(19) "ReflectionException" [24]=> string(13) "PharException" }
Output for 5.4.18 - 5.4.43
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(6) { [0]=> string(8) "DateTime" [1]=> string(12) "DateInterval" [2]=> string(10) "DatePeriod" [3]=> string(13) "SplFixedArray" [4]=> string(3) "PDO" [5]=> string(12) "PDOStatement" }
Output for 5.3.27 - 5.3.29, 5.4.17
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(5) { [0]=> string(8) "DateTime" [1]=> string(12) "DateInterval" [2]=> string(10) "DatePeriod" [3]=> string(3) "PDO" [4]=> string(12) "PDOStatement" }
Output for 5.3.19 - 5.3.26, 5.4.0 - 5.4.16
array(2) { [0]=> string(3) "PDO" [1]=> string(12) "PDOStatement" } array(4) { [0]=> string(8) "DateTime" [1]=> string(12) "DateInterval" [2]=> string(3) "PDO" [3]=> string(12) "PDOStatement" }