php-src/Zend/tests/gh12468_2.phpt
Ilija Tovilo af3d2f7ec9
Fix double-free of doc_comment when overriding static property via trait
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
2023-10-19 15:21:53 +02:00

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===