<?php
trait StaticExample {
public static function doSomething() {
return 'Doing something';
}
}
class Example {
use StaticExample;
}
echo Example::doSomething();
echo StaticExample::doSomething();
Doing something
Deprecated: Calling static trait method StaticExample::doSomething is deprecated, it should only be called on a class using the trait in /in/McjfP on line 13
Doing something