3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ErrorWrapper { public $context; public $var = self::INVALID; } stream_wrapper_register('error',ErrorWrapper::class); file_get_contents('error://test');
Output for 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Undefined constant self::INVALID in /in/KKqGn:4 Stack trace: #0 /in/KKqGn(7): [constant expression]() #1 /in/KKqGn(7): file_get_contents('error://test') #2 {main} thrown in /in/KKqGn on line 4
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: Undefined constant self::INVALID in /in/KKqGn:4 Stack trace: #0 /in/KKqGn(7): [constant expression]() #1 /in/KKqGn(7): file_get_contents('error://test') #2 {main} thrown in /in/KKqGn on line 4
Process exited with code 255.
Output for 8.2.0 - 8.2.18
Fatal error: Uncaught Error: Undefined constant self::INVALID in /in/KKqGn:4 Stack trace: #0 /in/KKqGn(7): file_get_contents('error://test') #1 {main} thrown in /in/KKqGn on line 4
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
Fatal error: Uncaught Error: Undefined constant self::INVALID in /in/KKqGn:7 Stack trace: #0 /in/KKqGn(7): file_get_contents('error://test') #1 {main} thrown in /in/KKqGn on line 7
Process exited with code 255.
Output for 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Undefined class constant 'self::INVALID' in /in/KKqGn:7 Stack trace: #0 /in/KKqGn(7): file_get_contents('error://test') #1 {main} thrown in /in/KKqGn on line 7
Process exited with code 255.
Output for 7.2.17 - 7.2.33, 7.3.4
Warning: file_get_contents(error://test): failed to open stream: operation failed in /in/KKqGn on line 7 Fatal error: Uncaught Error: Undefined class constant 'self::INVALID' in /in/KKqGn:7 Stack trace: #0 /in/KKqGn(7): file_get_contents('error://test') #1 {main} thrown in /in/KKqGn on line 7
Process exited with code 255.
Output for 7.1.25 - 7.1.28, 7.2.0 - 7.2.16, 7.3.0 - 7.3.3

Process exited with code 139.

preferences:
153.57 ms | 402 KiB | 163 Q