Skip to Content
PHPCODE
Access Levels in Traits
oops code / August 12, 2018
<?php
trait abc {
private function xyz()
{
echo “XYZ method from trait abc”;
}
}
class test {
use abc{
abc::xyz as public abcXyz;
}
}
$obj=new test;
$obj->abcXyz();?>
Comments
No comments yet, take the initiative.

Leave a Reply

Your email address will not be published.

PHPCODE © 2023