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.25, 8.4.1 - 8.4.12
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.29
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.33
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:
145.52 ms | 413 KiB | 5 Q