3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { public static function foo() { $this->assert(); } public function assert() {} } X::foo();
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.29, 8.4.1 - 8.4.16, 8.5.0 - 8.5.1
Fatal error: Uncaught Error: Using $this when not in object context in /in/u9ENa:7 Stack trace: #0 /in/u9ENa(14): X::foo() #1 {main} thrown in /in/u9ENa on line 7
Process exited with code 255.

preferences:
60.1 ms | 406 KiB | 5 Q