3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = new stdClass; $foo->bar = 1; var_dump((new ReflectionObject($foo))->getProperties()[0]->getType()->__toString());
Output for 7.4.9 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Call to a member function __toString() on null in /in/2nH6H:5 Stack trace: #0 {main} thrown in /in/2nH6H on line 5
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 Error: Call to a member function __toString() on null in /in/2nH6H:5 Stack trace: #0 {main} thrown in /in/2nH6H on line 5
Process exited with code 255.
Output for 7.4.8
Deprecated: Function ReflectionType::__toString() is deprecated in /in/2nH6H on line 5 string(94539089583328) "
Process exited with code 255.
Output for 7.4.7
Deprecated: Function ReflectionType::__toString() is deprecated in /in/2nH6H on line 5 string(94223665831136) "
Process exited with code 255.
Output for 7.4.6
Deprecated: Function ReflectionType::__toString() is deprecated in /in/2nH6H on line 5 string(94211366722768) "
Process exited with code 255.
Output for 7.4.5
Deprecated: Function ReflectionType::__toString() is deprecated in /in/2nH6H on line 5 string(94747459638000) "
Process exited with code 255.
Output for 7.4.4
Deprecated: Function ReflectionType::__toString() is deprecated in /in/2nH6H on line 5 string(94736257991408) "
Process exited with code 255.
Output for 7.4.3
Deprecated: Function ReflectionType::__toString() is deprecated in /in/2nH6H on line 5 string(93945440563952) "
Process exited with code 255.
Output for 7.4.2
Deprecated: Function ReflectionType::__toString() is deprecated in /in/2nH6H on line 5 string(94571364049648) "
Process exited with code 255.
Output for 7.4.1
Deprecated: Function ReflectionType::__toString() is deprecated in /in/2nH6H on line 5 string(94838331548400) "
Process exited with code 255.
Output for 7.4.0
Deprecated: Function ReflectionType::__toString() is deprecated in /in/2nH6H on line 5 string(93898905764592) "
Process exited with code 255.
Output for 7.3.0 - 7.3.33
Fatal error: Uncaught Error: Call to undefined method ReflectionProperty::getType() in /in/2nH6H:5 Stack trace: #0 {main} thrown in /in/2nH6H on line 5
Process exited with code 255.

preferences:
144.89 ms | 401 KiB | 156 Q