mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00

This cherry-picks33969c2252
and2effbfd871
from PHP-8.0. The issues these commits fix could also manifest in PHP 7.4, and a commenter on bug #80307 reports this this might indeed be happening.
33 lines
465 B
PHP
33 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 {}
|