3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public function method() { return parent::$property; } } $myClass = new MyClass; $myClass->method();
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.24, 8.2.0 - 8.2.11
Fatal error: Cannot use "parent" when current class scope has no parent in /in/BTk8t on line 6
Process exited with code 255.
Output for 7.4.33
Deprecated: Cannot use "parent" when current class scope has no parent in /in/BTk8t on line 6 Fatal error: Uncaught Error: Cannot access parent:: when current class scope has no parent in /in/BTk8t:6 Stack trace: #0 /in/BTk8t(10): MyClass->method() #1 {main} thrown in /in/BTk8t on line 6
Process exited with code 255.

preferences:
168.92 ms | 1458 KiB | 7 Q