<?php
namespace One {
trait foo {
static $bar = [];
public static function a() {
echo "Hello World";
}
}
}
namespace Two {
use One\foo as OneFoo;
trait foo {
use OneFoo;
public static function a() {
self::$bar = ["foo"];
echo "Goodbye Moon";
}
}
}
namespace Three {
class qux {
use \One\foo;
public static function a() {
\Two\foo::a();
}
}
class bing extends qux {
use \Two\foo;
public static function a() {
\Two\foo::a();
var_dump(self::$bar);
}
}
}
namespace {
\Three\bing::a();
}
Deprecated: Calling static trait method Two\foo::a is deprecated, it should only be called on a class using the trait in /in/fv5iY on line 39
Deprecated: Accessing static trait property Two\foo::$bar is deprecated, it should only be accessed on a class using the trait in /in/fv5iY on line 19
Goodbye Moonarray(0) {
}
Fatal error: Three\qux and Two\foo define the same property ($bar) in the composition of Three\bing. However, the definition differs and is considered incompatible. Class was composed in /in/fv5iY on line 35
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Strict Standards: Three\qux and Two\foo define the same property ($bar) in the composition of Three\bing. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in /in/fv5iY on line 42
Goodbye Moonarray(0) {
}
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
Fatal error: Three\qux and Two\foo define the same property ($bar) in the composition of Three\bing. However, the definition differs and is considered incompatible. Class was composed in /in/fv5iY on line 42
Process exited with code 255.