PHP 5 behaved slightly different

r342129 only documented the PHP 7 behavior, but the manual is supposed
to describe PHP 5, too.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@342154 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker 2017-03-17 13:36:48 +00:00
parent 62e49c2b1b
commit cc8ca60530

View file

@ -444,6 +444,8 @@ $example->x;
If a trait defines a property then a class can not define a property with
the same name unless it is compatible (same visibility and initial value),
otherwise a fatal error is issued.
Before PHP 7.0.0, defining a property in the class with the same visibility
and initial value as in the trait, raised an E_STRICT notice.
</para>
<example xml:id="language.oop5.traits.properties.conflicts">
<title>Conflict Resolution</title>
@ -457,7 +459,7 @@ trait PropertiesTrait {
class PropertiesExample {
use PropertiesTrait;
public $same = true; // Allowed
public $same = true; // Allowed as of PHP 7.0.0; E_STRICT notice formerly
public $different = true; // Fatal error
}
?>