1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/opcache/tests/gh18567.phpt
Niels Dossche 41e11a627d Fix GH-18567: Preloading with internal class alias triggers assertion failure
The assertion is imprecise now, and the code assumed that from the
moment an internal class was encountered that there were only internal
classes remaining. This is wrong now, and we still have to continue if
we encounter an internal class. We can only skip the remaining iterations
if the entry in the hash table is not an alias.

Closes GH-18575.
2025-05-19 19:19:26 +02:00

28 lines
561 B
PHP

--TEST--
GH-18567 (Preloading with internal class alias triggers assertion failure)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.preload={PWD}/preload_gh18567.inc
--EXTENSIONS--
opcache
--SKIPIF--
<?php
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
?>
--FILE--
<?php
abstract class Test implements MyStringable {
}
$rc = new ReflectionClass(Test::class);
var_dump($rc->getInterfaces());
?>
--EXPECT--
array(1) {
["Stringable"]=>
object(ReflectionClass)#2 (1) {
["name"]=>
string(10) "Stringable"
}
}