1.2.565. Incompatible Property Between Class And Trait

Reports a property definition that doesn’t fit the importing class. The property definition should be identical in the trait and in the class.

<?php

trait t {
     private Invalid $property1;

     private Valid $property2;
}

class xt {
     use t;

     // This is incompatible with the trait
     private OtherType $property1;

     // This is compatible with the trait
     private Valid $property2;
}

?>