<?php
interface ContactFieldsInterface {
public function getEmail();
}
trait ContactFieldsTrait
{
protected $email;
public function getEmail() {
return $this->email;
}
}
class User {
protected $email;
}
class Contact extends User implements ContactFieldsInterface
{
use ContactFieldsTrait {
User::email insteadof ContactFieldsTrait;
}
}
Fatal error: Class User is not a trait, Only traits may be used in 'as' and 'insteadof' statements in /in/s5NUd on line 23
Process exited with code 255.
Fatal error: Class User is not a trait, Only traits may be used in 'as' and 'insteadof' statements in /in/s5NUd on line 30
Process exited with code 255.
Output for 5.4.11 - 5.4.12
Fatal error: Trait User is not used in /in/s5NUd on line 30
Process exited with code 255.
Output for 5.4.0 - 5.4.10
Fatal error: A precedence rule was defined for User::email but this method does not exist in /in/s5NUd on line 30
Process exited with code 255.