php-src/Zend/tests/gh12366.inc
Ilija Tovilo 53dbb760da
Fix use-after-free of constant name
The constant name is usually interend. Without opcache, compilation always
interns strings. Without opcache, compilation does not intern (new) strings, but
persisting of script does. If a script is not stored in shm the constant name
will not be interned.

The building of enum backing stores was missing a addref for the constant name,
leading to a double-free when releasing constants and backing stores of enums.

Fixes GH-12366
Closes GH-12405
2023-10-11 11:49:40 +02:00

8 lines
74 B
PHP

<?php
enum Level: int {
case Debug = 100;
}
var_dump(Level::Debug);