1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/tests/classes/abstract_derived.phpt
DanielEScherzer 0b94cf65e4 GH-16067: prevent invalid abstract during compilation of methods (GH-16069)
For classes that are not declared `abstract`, produce a compiler error for any
`abstract` methods. For anonymous classes, since they cannot be made abstract,
the error message is slightly different.

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-10-23 15:04:18 +02:00

17 lines
326 B
PHP

--TEST--
ZE2 A derived class with an abstract method must be abstract
--FILE--
<?php
class base {
}
class derived extends base {
abstract function show();
}
?>
===DONE===
--EXPECTF--
Fatal error: Class derived declares abstract method show() and must therefore be declared abstract in %sabstract_derived.php on line %d