mirror of
https://github.com/php/php-src.git
synced 2026-04-19 22:11:12 +02:00
In order of preference, the generated name will be:
new class extends ParentClass {};
// -> ParentClass@anonymous
new class implements FirstInterface, SecondInterface {};
// -> FirstInterface@anonymous
new class {};
// -> class@anonymous
This is intended to display a more useful class name in error messages
and stack traces, and thus make debugging easier.
Closes GH-5153.
10 lines
276 B
PHP
10 lines
276 B
PHP
--TEST--
|
|
FR: #78638 (__PHP_Incomplete_Class should be final)
|
|
--FILE--
|
|
<?php
|
|
$c = new class('bar') extends __PHP_Incomplete_Class {
|
|
};
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Class __PHP_Incomplete_Class@anonymous may not inherit from final class (__PHP_Incomplete_Class) in %s on line %d
|