3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface someInterface { public function wibble(); } trait someTrait { public function wibble() { echo 'wibble'; } } class someClass implements someInterface { use someTrait { wibble as private; } public function doWibble() { $this->wibble(); } } $someObject = new someClass(); $someObject->doWibble();
based on eUprM
Output for 7.0.6 - 7.2.0
Fatal error: Access level to someClass::wibble() must be public (as in class someInterface) in /in/vWu89 on line 14
Process exited with code 255.
Output for 7.0.0 - 7.0.5
Fatal error: Access level to someTrait::wibble() must be public (as in class someInterface) in /in/vWu89 on line 14
Process exited with code 255.
Output for 5.5.25 - 5.5.35, 5.6.9 - 5.6.28
Fatal error: Access level to someTrait::wibble() must be public (as in class someInterface) in /in/vWu89 on line 23
Process exited with code 255.
Output for 5.4.11 - 5.5.24, 5.6.8
wibble
Output for 5.4.8 - 5.4.10
Fatal error: Access level to someClass::wibble() must be public (as in class someInterface) in /in/vWu89 on line 23
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/vWu89 on line 7
Process exited with code 255.