mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
62e49c2b1b
commit
cc8ca60530
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue