3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php interface i { protected function getVar(); public function __construct(); } class a implements i { protected $var; public function __construct() { $this->var = 'no value'; } public function getVar() { return $this->var; } } class b extends a { public function __construct($var = 'no value') { $this->var = $var; } } $a = new a(); echo $a->getVar()."\n"; $b = new b('a value'); echo $b->getVar()."\n";
Output for 5.3.0 - 5.4.8
Fatal error: Access type for interface method i::getVar() must be omitted in /in/6M0HJ on line 5
Process exited with code 255.