mirror of
https://github.com/php/php-src.git
synced 2024-10-02 23:36:16 +00:00
525dd55eed
# The handling of private properties in classes is now consistent with private properties in traits. # Perviously, privates could cause strict warnings, are were not properly merged into the class when # the parent class had a private property of the same name. Now, we introduce it without notice, # since it is a new and independent property, just like in normal classes. # This problem was diagnosed while working on Bug #60536.
26 lines
315 B
PHP
26 lines
315 B
PHP
--TEST--
|
|
Bug #60536 (Traits Segfault)
|
|
--FILE--
|
|
<?php
|
|
trait T { private $x = 0; }
|
|
class X {
|
|
use T;
|
|
}
|
|
class Y extends X {
|
|
use T;
|
|
function x() {
|
|
return ++$this->x;
|
|
}
|
|
}
|
|
class Z extends Y {
|
|
function z() {
|
|
return ++$this->x;
|
|
}
|
|
}
|
|
$a = new Z();
|
|
$a->x();
|
|
echo "DONE";
|
|
?>
|
|
--EXPECTF--
|
|
DONE
|