I have a client using Rackspace Cloud Sites which advertise PHP 5.4 on their platform but I have been advised via their online support that traits cannot be used.
When using traits I receive a 500 error and finding no issue with the code I asked their online support to be told "it is not allowed in our environment". Using the basic PHP example code below results in a 500 Internal Server Error:
class Base {
public function sayHello() {
echo 'Hello ';
}
}
trait SayWorld {
public function sayHello() {
parent::sayHello();
echo 'World!';
}
}
class MyHelloWorld extends Base {
use SayWorld;
}
$o = new MyHelloWorld();
$o->sayHello();
Is there some reason why Traits would be disabled or can they even be disabled? The version reported by phpinfo() is 5.4.10.