mirror of
https://github.com/php/php-src.git
synced 2024-12-16 05:15:03 +08:00
af3d2f7ec9
When redeclaring an overridden static property with a trait we're removing the
property from the class. However, because the property itself does not belong to
the class we must not free its associated data.
This issue is exposed by 9a250cc9d6
in PHP 8.3+ because duplicate static
properties in traits are no longer skipped, but redeclared.
Fixes GH-12468
20 lines
279 B
PHP
20 lines
279 B
PHP
--TEST--
|
|
GH-12468: Double-free of doc_comment when overriding static property via trait
|
|
--FILE--
|
|
<?php
|
|
trait T {
|
|
/** some doc */
|
|
static protected $a = 0;
|
|
}
|
|
class A {
|
|
/** some doc */
|
|
static protected $a = 0;
|
|
}
|
|
class B extends A {
|
|
use T;
|
|
}
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
===DONE===
|