3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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();
based on UM7Eu
Output for 5.4.10 - 7.2.0
OK
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/07rXY on line 9
Process exited with code 255.