3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface ID8 { const HOST = 'test'; } class a implements ID8 { public $b = parent::HOST; } $ab = new a(); print $ab->b;
based on YuhvK
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot access parent:: when current class scope has no parent in /in/nniYW:11 Stack trace: #0 {main} thrown in /in/nniYW on line 11
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Cannot access parent:: when current class scope has no parent in /in/nniYW on line 11
Process exited with code 255.