3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface FabricAwareInterface { public function setFabric($fabric); protected function getFabric(); } trait FabricAware { private $_fabric; public function setFabric($f) { $this->_fabric = $f; } protected function getFabric() { return $this->_fabric; } } class ClassA implements FabricAwareInterface { use FabricAware; public function init() { echo 'OK'; } } $a = new ClassA(); $a->init();
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
Fatal error: Access type for interface method FabricAwareInterface::getFabric() must be omitted in /in/UM7Eu on line 6
Process exited with code 255.

preferences:
166.13 ms | 1395 KiB | 23 Q