3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump( array_filter( get_declared_classes(), function ($className) { return (new \ReflectionClass($className))->hasMethod('__toString'); } ) );
based on mQ1CI
Output for 7.2.6
array(55) { [1]=> string(9) "Exception" [2]=> string(14) "ErrorException" [3]=> string(5) "Error" [4]=> string(10) "ParseError" [5]=> string(9) "TypeError" [6]=> string(18) "ArgumentCountError" [7]=> string(15) "ArithmeticError" [8]=> string(19) "DivisionByZeroError" [11]=> string(24) "ClosedGeneratorException" [21]=> string(12) "DOMException" [54]=> string(14) "LogicException" [55]=> string(24) "BadFunctionCallException" [56]=> string(22) "BadMethodCallException" [57]=> string(15) "DomainException" [58]=> string(24) "InvalidArgumentException" [59]=> string(15) "LengthException" [60]=> string(19) "OutOfRangeException" [61]=> string(16) "RuntimeException" [62]=> string(20) "OutOfBoundsException" [63]=> string(17) "OverflowException" [64]=> string(14) "RangeException" [65]=> string(18) "UnderflowException" [66]=> string(24) "UnexpectedValueException" [75]=> string(15) "CachingIterator" [76]=> string(24) "RecursiveCachingIterator" [87]=> string(11) "SplFileInfo" [88]=> string(17) "DirectoryIterator" [89]=> string(18) "FilesystemIterator" [90]=> string(26) "RecursiveDirectoryIterator" [91]=> string(12) "GlobIterator" [92]=> string(13) "SplFileObject" [93]=> string(17) "SplTempFileObject" [104]=> string(12) "PDOException" [109]=> string(19) "ReflectionException" [111]=> string(26) "ReflectionFunctionAbstract" [112]=> string(18) "ReflectionFunction" [114]=> string(19) "ReflectionParameter" [115]=> string(14) "ReflectionType" [116]=> string(19) "ReflectionNamedType" [117]=> string(16) "ReflectionMethod" [118]=> string(15) "ReflectionClass" [119]=> string(16) "ReflectionObject" [120]=> string(18) "ReflectionProperty" [121]=> string(23) "ReflectionClassConstant" [122]=> string(19) "ReflectionExtension" [123]=> string(23) "ReflectionZendExtension" [127]=> string(14) "AssertionError" [128]=> string(16) "SimpleXMLElement" [129]=> string(17) "SimpleXMLIterator" [130]=> string(13) "PharException" [131]=> string(4) "Phar" [132]=> string(8) "PharData" [133]=> string(12) "PharFileInfo" [149]=> string(13) "IntlException" [157]=> string(15) "SodiumException" }
Output for 7.2.0
array(54) { [1]=> string(9) "Exception" [2]=> string(14) "ErrorException" [3]=> string(5) "Error" [4]=> string(10) "ParseError" [5]=> string(9) "TypeError" [6]=> string(18) "ArgumentCountError" [7]=> string(15) "ArithmeticError" [8]=> string(19) "DivisionByZeroError" [11]=> string(24) "ClosedGeneratorException" [21]=> string(12) "DOMException" [54]=> string(14) "LogicException" [55]=> string(24) "BadFunctionCallException" [56]=> string(22) "BadMethodCallException" [57]=> string(15) "DomainException" [58]=> string(24) "InvalidArgumentException" [59]=> string(15) "LengthException" [60]=> string(19) "OutOfRangeException" [61]=> string(16) "RuntimeException" [62]=> string(20) "OutOfBoundsException" [63]=> string(17) "OverflowException" [64]=> string(14) "RangeException" [65]=> string(18) "UnderflowException" [66]=> string(24) "UnexpectedValueException" [75]=> string(15) "CachingIterator" [76]=> string(24) "RecursiveCachingIterator" [87]=> string(11) "SplFileInfo" [88]=> string(17) "DirectoryIterator" [89]=> string(18) "FilesystemIterator" [90]=> string(26) "RecursiveDirectoryIterator" [91]=> string(12) "GlobIterator" [92]=> string(13) "SplFileObject" [93]=> string(17) "SplTempFileObject" [104]=> string(12) "PDOException" [109]=> string(19) "ReflectionException" [111]=> string(26) "ReflectionFunctionAbstract" [112]=> string(18) "ReflectionFunction" [114]=> string(19) "ReflectionParameter" [115]=> string(14) "ReflectionType" [116]=> string(19) "ReflectionNamedType" [117]=> string(16) "ReflectionMethod" [118]=> string(15) "ReflectionClass" [119]=> string(16) "ReflectionObject" [120]=> string(18) "ReflectionProperty" [121]=> string(23) "ReflectionClassConstant" [122]=> string(19) "ReflectionExtension" [123]=> string(23) "ReflectionZendExtension" [127]=> string(14) "AssertionError" [128]=> string(16) "SimpleXMLElement" [129]=> string(17) "SimpleXMLIterator" [130]=> string(13) "PharException" [131]=> string(4) "Phar" [132]=> string(8) "PharData" [133]=> string(12) "PharFileInfo" [149]=> string(13) "IntlException" }
Output for 7.1.0 - 7.1.20
array(54) { [1]=> string(9) "Exception" [2]=> string(14) "ErrorException" [3]=> string(5) "Error" [4]=> string(10) "ParseError" [5]=> string(9) "TypeError" [6]=> string(18) "ArgumentCountError" [7]=> string(15) "ArithmeticError" [8]=> string(19) "DivisionByZeroError" [11]=> string(24) "ClosedGeneratorException" [21]=> string(12) "DOMException" [53]=> string(14) "LogicException" [54]=> string(24) "BadFunctionCallException" [55]=> string(22) "BadMethodCallException" [56]=> string(15) "DomainException" [57]=> string(24) "InvalidArgumentException" [58]=> string(15) "LengthException" [59]=> string(19) "OutOfRangeException" [60]=> string(16) "RuntimeException" [61]=> string(20) "OutOfBoundsException" [62]=> string(17) "OverflowException" [63]=> string(14) "RangeException" [64]=> string(18) "UnderflowException" [65]=> string(24) "UnexpectedValueException" [74]=> string(15) "CachingIterator" [75]=> string(24) "RecursiveCachingIterator" [86]=> string(11) "SplFileInfo" [87]=> string(17) "DirectoryIterator" [88]=> string(18) "FilesystemIterator" [89]=> string(26) "RecursiveDirectoryIterator" [90]=> string(12) "GlobIterator" [91]=> string(13) "SplFileObject" [92]=> string(17) "SplTempFileObject" [103]=> string(12) "PDOException" [108]=> string(19) "ReflectionException" [110]=> string(26) "ReflectionFunctionAbstract" [111]=> string(18) "ReflectionFunction" [113]=> string(19) "ReflectionParameter" [114]=> string(14) "ReflectionType" [115]=> string(19) "ReflectionNamedType" [116]=> string(16) "ReflectionMethod" [117]=> string(15) "ReflectionClass" [118]=> string(16) "ReflectionObject" [119]=> string(18) "ReflectionProperty" [120]=> string(23) "ReflectionClassConstant" [121]=> string(19) "ReflectionExtension" [122]=> string(23) "ReflectionZendExtension" [126]=> string(14) "AssertionError" [127]=> string(16) "SimpleXMLElement" [128]=> string(17) "SimpleXMLIterator" [129]=> string(13) "PharException" [130]=> string(4) "Phar" [131]=> string(8) "PharData" [132]=> string(12) "PharFileInfo" [148]=> string(13) "IntlException" }
Output for 7.0.14 - 7.0.20
array(51) { [1]=> string(9) "Exception" [2]=> string(14) "ErrorException" [3]=> string(5) "Error" [4]=> string(10) "ParseError" [5]=> string(9) "TypeError" [6]=> string(15) "ArithmeticError" [7]=> string(19) "DivisionByZeroError" [10]=> string(24) "ClosedGeneratorException" [20]=> string(12) "DOMException" [52]=> string(14) "LogicException" [53]=> string(24) "BadFunctionCallException" [54]=> string(22) "BadMethodCallException" [55]=> string(15) "DomainException" [56]=> string(24) "InvalidArgumentException" [57]=> string(15) "LengthException" [58]=> string(19) "OutOfRangeException" [59]=> string(16) "RuntimeException" [60]=> string(20) "OutOfBoundsException" [61]=> string(17) "OverflowException" [62]=> string(14) "RangeException" [63]=> string(18) "UnderflowException" [64]=> string(24) "UnexpectedValueException" [73]=> string(15) "CachingIterator" [74]=> string(24) "RecursiveCachingIterator" [85]=> string(11) "SplFileInfo" [86]=> string(17) "DirectoryIterator" [87]=> string(18) "FilesystemIterator" [88]=> string(26) "RecursiveDirectoryIterator" [89]=> string(12) "GlobIterator" [90]=> string(13) "SplFileObject" [91]=> string(17) "SplTempFileObject" [102]=> string(12) "PDOException" [107]=> string(19) "ReflectionException" [109]=> string(26) "ReflectionFunctionAbstract" [110]=> string(18) "ReflectionFunction" [112]=> string(19) "ReflectionParameter" [113]=> string(14) "ReflectionType" [114]=> string(16) "ReflectionMethod" [115]=> string(15) "ReflectionClass" [116]=> string(16) "ReflectionObject" [117]=> string(18) "ReflectionProperty" [118]=> string(19) "ReflectionExtension" [119]=> string(23) "ReflectionZendExtension" [123]=> string(14) "AssertionError" [124]=> string(16) "SimpleXMLElement" [125]=> string(17) "SimpleXMLIterator" [126]=> string(13) "PharException" [127]=> string(4) "Phar" [128]=> string(8) "PharData" [129]=> string(12) "PharFileInfo" [145]=> string(13) "IntlException" }
Output for 7.0.6 - 7.0.11
array(51) { [1]=> string(9) "Exception" [2]=> string(14) "ErrorException" [3]=> string(5) "Error" [4]=> string(10) "ParseError" [5]=> string(9) "TypeError" [6]=> string(15) "ArithmeticError" [7]=> string(19) "DivisionByZeroError" [10]=> string(24) "ClosedGeneratorException" [20]=> string(12) "DOMException" [52]=> string(14) "LogicException" [53]=> string(24) "BadFunctionCallException" [54]=> string(22) "BadMethodCallException" [55]=> string(15) "DomainException" [56]=> string(24) "InvalidArgumentException" [57]=> string(15) "LengthException" [58]=> string(19) "OutOfRangeException" [59]=> string(16) "RuntimeException" [60]=> string(20) "OutOfBoundsException" [61]=> string(17) "OverflowException" [62]=> string(14) "RangeException" [63]=> string(18) "UnderflowException" [64]=> string(24) "UnexpectedValueException" [73]=> string(15) "CachingIterator" [74]=> string(24) "RecursiveCachingIterator" [85]=> string(11) "SplFileInfo" [86]=> string(17) "DirectoryIterator" [87]=> string(18) "FilesystemIterator" [88]=> string(26) "RecursiveDirectoryIterator" [89]=> string(12) "GlobIterator" [90]=> string(13) "SplFileObject" [91]=> string(17) "SplTempFileObject" [102]=> string(12) "PDOException" [107]=> string(19) "ReflectionException" [109]=> string(26) "ReflectionFunctionAbstract" [110]=> string(18) "ReflectionFunction" [112]=> string(19) "ReflectionParameter" [113]=> string(14) "ReflectionType" [114]=> string(16) "ReflectionMethod" [115]=> string(15) "ReflectionClass" [116]=> string(16) "ReflectionObject" [117]=> string(18) "ReflectionProperty" [118]=> string(19) "ReflectionExtension" [119]=> string(23) "ReflectionZendExtension" [123]=> string(14) "AssertionError" [124]=> string(16) "SimpleXMLElement" [125]=> string(17) "SimpleXMLIterator" [126]=> string(13) "PharException" [127]=> string(4) "Phar" [128]=> string(8) "PharData" [129]=> string(12) "PharFileInfo" [144]=> string(13) "IntlException" }
Output for 7.0.0 - 7.0.5
array(51) { [1]=> string(9) "Exception" [2]=> string(14) "ErrorException" [3]=> string(5) "Error" [4]=> string(10) "ParseError" [5]=> string(9) "TypeError" [6]=> string(15) "ArithmeticError" [7]=> string(19) "DivisionByZeroError" [10]=> string(24) "ClosedGeneratorException" [20]=> string(12) "DOMException" [53]=> string(14) "LogicException" [54]=> string(24) "BadFunctionCallException" [55]=> string(22) "BadMethodCallException" [56]=> string(15) "DomainException" [57]=> string(24) "InvalidArgumentException" [58]=> string(15) "LengthException" [59]=> string(19) "OutOfRangeException" [60]=> string(16) "RuntimeException" [61]=> string(20) "OutOfBoundsException" [62]=> string(17) "OverflowException" [63]=> string(14) "RangeException" [64]=> string(18) "UnderflowException" [65]=> string(24) "UnexpectedValueException" [74]=> string(15) "CachingIterator" [75]=> string(24) "RecursiveCachingIterator" [86]=> string(11) "SplFileInfo" [87]=> string(17) "DirectoryIterator" [88]=> string(18) "FilesystemIterator" [89]=> string(26) "RecursiveDirectoryIterator" [90]=> string(12) "GlobIterator" [91]=> string(13) "SplFileObject" [92]=> string(17) "SplTempFileObject" [103]=> string(12) "PDOException" [108]=> string(19) "ReflectionException" [110]=> string(26) "ReflectionFunctionAbstract" [111]=> string(18) "ReflectionFunction" [113]=> string(19) "ReflectionParameter" [114]=> string(14) "ReflectionType" [115]=> string(16) "ReflectionMethod" [116]=> string(15) "ReflectionClass" [117]=> string(16) "ReflectionObject" [118]=> string(18) "ReflectionProperty" [119]=> string(19) "ReflectionExtension" [120]=> string(23) "ReflectionZendExtension" [124]=> string(14) "AssertionError" [125]=> string(16) "SimpleXMLElement" [126]=> string(17) "SimpleXMLIterator" [127]=> string(13) "PharException" [128]=> string(4) "Phar" [129]=> string(8) "PharData" [130]=> string(12) "PharFileInfo" [145]=> string(13) "IntlException" }
Output for 5.6.28
array(43) { [1]=> string(9) "Exception" [2]=> string(14) "ErrorException" [14]=> string(12) "DOMException" [46]=> string(14) "LogicException" [47]=> string(24) "BadFunctionCallException" [48]=> string(22) "BadMethodCallException" [49]=> string(15) "DomainException" [50]=> string(24) "InvalidArgumentException" [51]=> string(15) "LengthException" [52]=> string(19) "OutOfRangeException" [53]=> string(16) "RuntimeException" [54]=> string(20) "OutOfBoundsException" [55]=> string(17) "OverflowException" [56]=> string(14) "RangeException" [57]=> string(18) "UnderflowException" [58]=> string(24) "UnexpectedValueException" [67]=> string(15) "CachingIterator" [68]=> string(24) "RecursiveCachingIterator" [79]=> string(11) "SplFileInfo" [80]=> string(17) "DirectoryIterator" [81]=> string(18) "FilesystemIterator" [82]=> string(26) "RecursiveDirectoryIterator" [83]=> string(12) "GlobIterator" [84]=> string(13) "SplFileObject" [85]=> string(17) "SplTempFileObject" [96]=> string(12) "PDOException" [101]=> string(19) "ReflectionException" [103]=> string(26) "ReflectionFunctionAbstract" [104]=> string(18) "ReflectionFunction" [105]=> string(19) "ReflectionParameter" [106]=> string(16) "ReflectionMethod" [107]=> string(15) "ReflectionClass" [108]=> string(16) "ReflectionObject" [109]=> string(18) "ReflectionProperty" [110]=> string(19) "ReflectionExtension" [111]=> string(23) "ReflectionZendExtension" [115]=> string(16) "SimpleXMLElement" [116]=> string(17) "SimpleXMLIterator" [117]=> string(13) "PharException" [118]=> string(4) "Phar" [119]=> string(8) "PharData" [120]=> string(12) "PharFileInfo" [136]=> string(13) "IntlException" }
Output for 5.5.0 - 5.5.38, 5.6.21 - 5.6.25
array(43) { [1]=> string(9) "Exception" [2]=> string(14) "ErrorException" [14]=> string(12) "DOMException" [46]=> string(14) "LogicException" [47]=> string(24) "BadFunctionCallException" [48]=> string(22) "BadMethodCallException" [49]=> string(15) "DomainException" [50]=> string(24) "InvalidArgumentException" [51]=> string(15) "LengthException" [52]=> string(19) "OutOfRangeException" [53]=> string(16) "RuntimeException" [54]=> string(20) "OutOfBoundsException" [55]=> string(17) "OverflowException" [56]=> string(14) "RangeException" [57]=> string(18) "UnderflowException" [58]=> string(24) "UnexpectedValueException" [67]=> string(15) "CachingIterator" [68]=> string(24) "RecursiveCachingIterator" [79]=> string(11) "SplFileInfo" [80]=> string(17) "DirectoryIterator" [81]=> string(18) "FilesystemIterator" [82]=> string(26) "RecursiveDirectoryIterator" [83]=> string(12) "GlobIterator" [84]=> string(13) "SplFileObject" [85]=> string(17) "SplTempFileObject" [96]=> string(12) "PDOException" [101]=> string(19) "ReflectionException" [103]=> string(26) "ReflectionFunctionAbstract" [104]=> string(18) "ReflectionFunction" [105]=> string(19) "ReflectionParameter" [106]=> string(16) "ReflectionMethod" [107]=> string(15) "ReflectionClass" [108]=> string(16) "ReflectionObject" [109]=> string(18) "ReflectionProperty" [110]=> string(19) "ReflectionExtension" [111]=> string(23) "ReflectionZendExtension" [115]=> string(16) "SimpleXMLElement" [116]=> string(17) "SimpleXMLIterator" [117]=> string(13) "PharException" [118]=> string(4) "Phar" [119]=> string(8) "PharData" [120]=> string(12) "PharFileInfo" [135]=> string(13) "IntlException" }
Output for 5.6.0 - 5.6.20
array(43) { [1]=> string(9) "Exception" [2]=> string(14) "ErrorException" [14]=> string(12) "DOMException" [47]=> string(14) "LogicException" [48]=> string(24) "BadFunctionCallException" [49]=> string(22) "BadMethodCallException" [50]=> string(15) "DomainException" [51]=> string(24) "InvalidArgumentException" [52]=> string(15) "LengthException" [53]=> string(19) "OutOfRangeException" [54]=> string(16) "RuntimeException" [55]=> string(20) "OutOfBoundsException" [56]=> string(17) "OverflowException" [57]=> string(14) "RangeException" [58]=> string(18) "UnderflowException" [59]=> string(24) "UnexpectedValueException" [68]=> string(15) "CachingIterator" [69]=> string(24) "RecursiveCachingIterator" [80]=> string(11) "SplFileInfo" [81]=> string(17) "DirectoryIterator" [82]=> string(18) "FilesystemIterator" [83]=> string(26) "RecursiveDirectoryIterator" [84]=> string(12) "GlobIterator" [85]=> string(13) "SplFileObject" [86]=> string(17) "SplTempFileObject" [97]=> string(12) "PDOException" [102]=> string(19) "ReflectionException" [104]=> string(26) "ReflectionFunctionAbstract" [105]=> string(18) "ReflectionFunction" [106]=> string(19) "ReflectionParameter" [107]=> string(16) "ReflectionMethod" [108]=> string(15) "ReflectionClass" [109]=> string(16) "ReflectionObject" [110]=> string(18) "ReflectionProperty" [111]=> string(19) "ReflectionExtension" [112]=> string(23) "ReflectionZendExtension" [116]=> string(16) "SimpleXMLElement" [117]=> string(17) "SimpleXMLIterator" [118]=> string(13) "PharException" [119]=> string(4) "Phar" [120]=> string(8) "PharData" [121]=> string(12) "PharFileInfo" [136]=> string(13) "IntlException" }
Output for 5.4.7 - 5.4.45
array(42) { [1]=> string(9) "Exception" [2]=> string(14) "ErrorException" [12]=> string(12) "DOMException" [53]=> string(14) "LogicException" [54]=> string(24) "BadFunctionCallException" [55]=> string(22) "BadMethodCallException" [56]=> string(15) "DomainException" [57]=> string(24) "InvalidArgumentException" [58]=> string(15) "LengthException" [59]=> string(19) "OutOfRangeException" [60]=> string(16) "RuntimeException" [61]=> string(20) "OutOfBoundsException" [62]=> string(17) "OverflowException" [63]=> string(14) "RangeException" [64]=> string(18) "UnderflowException" [65]=> string(24) "UnexpectedValueException" [74]=> string(15) "CachingIterator" [75]=> string(24) "RecursiveCachingIterator" [86]=> string(11) "SplFileInfo" [87]=> string(17) "DirectoryIterator" [88]=> string(18) "FilesystemIterator" [89]=> string(26) "RecursiveDirectoryIterator" [90]=> string(12) "GlobIterator" [91]=> string(13) "SplFileObject" [92]=> string(17) "SplTempFileObject" [103]=> string(12) "PDOException" [108]=> string(19) "ReflectionException" [110]=> string(26) "ReflectionFunctionAbstract" [111]=> string(18) "ReflectionFunction" [112]=> string(19) "ReflectionParameter" [113]=> string(16) "ReflectionMethod" [114]=> string(15) "ReflectionClass" [115]=> string(16) "ReflectionObject" [116]=> string(18) "ReflectionProperty" [117]=> string(19) "ReflectionExtension" [118]=> string(23) "ReflectionZendExtension" [122]=> string(16) "SimpleXMLElement" [123]=> string(17) "SimpleXMLIterator" [124]=> string(13) "PharException" [125]=> string(4) "Phar" [126]=> string(8) "PharData" [127]=> string(12) "PharFileInfo" }
Output for 5.4.0 - 5.4.6
array(42) { [1]=> string(9) "Exception" [2]=> string(14) "ErrorException" [12]=> string(12) "DOMException" [52]=> string(14) "LogicException" [53]=> string(24) "BadFunctionCallException" [54]=> string(22) "BadMethodCallException" [55]=> string(15) "DomainException" [56]=> string(24) "InvalidArgumentException" [57]=> string(15) "LengthException" [58]=> string(19) "OutOfRangeException" [59]=> string(16) "RuntimeException" [60]=> string(20) "OutOfBoundsException" [61]=> string(17) "OverflowException" [62]=> string(14) "RangeException" [63]=> string(18) "UnderflowException" [64]=> string(24) "UnexpectedValueException" [73]=> string(15) "CachingIterator" [74]=> string(24) "RecursiveCachingIterator" [85]=> string(11) "SplFileInfo" [86]=> string(17) "DirectoryIterator" [87]=> string(18) "FilesystemIterator" [88]=> string(26) "RecursiveDirectoryIterator" [89]=> string(12) "GlobIterator" [90]=> string(13) "SplFileObject" [91]=> string(17) "SplTempFileObject" [102]=> string(12) "PDOException" [107]=> string(19) "ReflectionException" [109]=> string(26) "ReflectionFunctionAbstract" [110]=> string(18) "ReflectionFunction" [111]=> string(19) "ReflectionParameter" [112]=> string(16) "ReflectionMethod" [113]=> string(15) "ReflectionClass" [114]=> string(16) "ReflectionObject" [115]=> string(18) "ReflectionProperty" [116]=> string(19) "ReflectionExtension" [117]=> string(23) "ReflectionZendExtension" [121]=> string(16) "SimpleXMLElement" [122]=> string(17) "SimpleXMLIterator" [123]=> string(13) "PharException" [124]=> string(4) "Phar" [125]=> string(8) "PharData" [126]=> string(12) "PharFileInfo" }
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/oaf2n on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/oaf2n on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/oaf2n on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/oaf2n on line 6
Process exited with code 255.