<?php
trait Hash
{
public function generateId()
{
return uniqid();
}
public function generateMD5($param)
{
return md5(param);
}
}
trait HtmlDecorator
{
public function decorateHtml($param)
{
return '<html>'.$param.'</html>';
}
public function decorateBold($param)
{
return '<b>'.$param.'</b>';
}
public function decorateBody($param)
{
return '<body>'.$param.'</body>';
}
}
interface Hashable
{
function generateMD5($param);
}
class User implements Hashable
{
use HtmlDecorator,Hash;
}
print (new User())->generateMD5("Kevin");
Warning: Use of undefined constant param - assumed 'param' (this will throw an Error in a future version of PHP) in /in/BPAO4 on line 10
eca07335a33c5aeb5e1bc7c98b4b9d80