3v4l.org

run code in 500+ 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.37, 8.4.1 - 8.4.28, 8.5.0 - 8.5.13, 8.6.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.36
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.34
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.3.4, 7.2.17 - 7.2.33
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.3.0 - 7.3.3, 7.1.25 - 7.1.33, 7.2.0 - 7.2.16

preferences:
32.14 ms | 1185 KiB | 6 Q