3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private static $bar; } var_dump(array_merge( [], ...array_map( function ($symbol) { return array_map( function (\ReflectionProperty $property) { return ($property->getDeclaringClass()->getName()) . '::$' . $property->getName(); }, array_filter( (new \ReflectionClass($symbol))->getMethods(), function (\ReflectionProperty $property) { return $property->isStatic(); } ) ); }, array_merge(get_declared_classes(), get_declared_traits()) ) ));
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($property) must be of type ReflectionProperty, ReflectionMethod given in /in/aCs3f:18 Stack trace: #0 [internal function]: {closure}(Object(ReflectionMethod)) #1 /in/aCs3f(16): array_filter(Array, Object(Closure)) #2 [internal function]: {closure}('InternalIterato...') #3 /in/aCs3f(10): array_map(Object(Closure), Array) #4 {main} thrown in /in/aCs3f on line 18
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($property) must be of type ReflectionProperty, ReflectionMethod given in /in/aCs3f:18 Stack trace: #0 [internal function]: {closure}(Object(ReflectionMethod)) #1 /in/aCs3f(16): array_filter(Array, Object(Closure)) #2 [internal function]: {closure}('InternalIterato...') #3 /in/aCs3f(10): array_map(Object(Closure), Array) #4 {main} thrown in /in/aCs3f on line 18
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($property) must be of type ReflectionProperty, ReflectionMethod given in /in/aCs3f:18 Stack trace: #0 [internal function]: {closure}(Object(ReflectionMethod)) #1 /in/aCs3f(20): array_filter(Array, Object(Closure)) #2 [internal function]: {closure}('InternalIterato...') #3 /in/aCs3f(24): array_map(Object(Closure), Array) #4 {main} thrown in /in/aCs3f on line 18
Process exited with code 255.
Output for 7.0.19 - 7.0.33, 7.1.5 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: Argument 1 passed to {closure}() must be an instance of ReflectionProperty, instance of ReflectionMethod given in /in/aCs3f:18 Stack trace: #0 [internal function]: {closure}(Object(ReflectionMethod)) #1 /in/aCs3f(20): array_filter(Array, Object(Closure)) #2 [internal function]: {closure}('Exception') #3 /in/aCs3f(24): array_map(Object(Closure), Array) #4 {main} thrown in /in/aCs3f on line 18
Process exited with code 255.
Output for 7.0.0 - 7.0.18, 7.1.0 - 7.1.4
Fatal error: Uncaught TypeError: Argument 1 passed to {closure}() must be an instance of ReflectionProperty, instance of ReflectionMethod given in /in/aCs3f:18 Stack trace: #0 [internal function]: {closure}(Object(ReflectionMethod)) #1 /in/aCs3f(20): array_filter(Array, Object(Closure)) #2 [internal function]: {closure}('Exception') #3 /in/aCs3f(23): array_map(Object(Closure), Array) #4 {main} thrown in /in/aCs3f on line 18
Process exited with code 255.
Output for 5.6.0 - 5.6.38
Catchable fatal error: Argument 1 passed to {closure}() must be an instance of ReflectionProperty, instance of ReflectionMethod given in /in/aCs3f on line 18
Process exited with code 255.
Output for 5.5.0 - 5.5.38
Parse error: syntax error, unexpected '.' in /in/aCs3f on line 10
Process exited with code 255.

preferences:
220.4 ms | 401 KiB | 322 Q