3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { protected ?string $context = null; public function run() { assert( $this->context !== null, 'Context must be set before run() is called' ); } } (new A())->run();
Output for 8.2.0 - 8.2.36, 8.3.0 - 8.3.37, 8.4.1 - 8.4.28, 8.5.0 - 8.5.13, 8.6.0
Fatal error: Uncaught AssertionError: Context must be set before run() is called in /in/DFddo:9 Stack trace: #0 /in/DFddo(9): assert(false, 'Context must be...') #1 /in/DFddo(16): A->run() #2 {main} thrown in /in/DFddo on line 9
Process exited with code 255.
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34
Fatal error: Uncaught AssertionError: Context must be set before run() is called in /in/DFddo:11 Stack trace: #0 /in/DFddo(11): assert(false, 'Context must be...') #1 /in/DFddo(16): A->run() #2 {main} thrown in /in/DFddo on line 11
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: assert(): Context must be set before run() is called failed in /in/DFddo on line 11

preferences:
17.96 ms | 1170 KiB | 6 Q