1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 00:48:25 +02:00
Files
archived-php-src/ext/opcache/tests/preload_trait_multiple_fixup.inc
T
Nikita Popov 2effbfd871 Fixup trait methods even if no traits are used
Trait methods might be non-trivially inherited, in which case we
may have to perform fixup in classes that do not directly use any
traits.
2020-11-05 13:15:32 +01:00

34 lines
465 B
PHP

<?php
trait T1 {
public function method() {
// Needs to be optimized somehow.
$str = "Foo";
echo "$str\n";
}
}
trait T2 {}
class C1 {
use T1;
}
class C2 extends C1 {
use T2;
}
trait T3 {
public function method() {
// Prevent trivial inheritance.
static $x;
// Needs to be optimized somehow.
$str = "Foo";
echo "$str\n";
}
}
class C3 {
use T3;
}
class C4 extends C3 {}